test_that("layout_horizontal respects show_theme_button = FALSE and skips theme items", { theme_a <- shiny::tags$a(href = "#", class = "theme-toggle", "Tabler Unit Testing") theme_li <- shiny::tags$li(class = "mt-auto", theme_a) ul <- shiny::tags$ul(theme_li) aside_tag <- shiny::tags$aside( class = "navbar navbar-vertical", shiny::tags$div( class = "container-fluid", shiny::tags$div(class = "collapse navbar-collapse", id = "sidebar-menu", ul) ) ) out_with <- layout_horizontal(aside_tag, NULL, tabler_body("H"), NULL, show_theme_button = TRUE) out_without <- layout_horizontal(aside_tag, NULL, tabler_body("H"), NULL, show_theme_button = FALSE) expect_true(grepl("Tabler Unit Testing", as.character(out_with))) # When show_theme_button is FALSE the theme link should not be present expect_false(grepl("Tabler Unit Testing", as.character(out_without))) })