test_that("layout_fluid extracts nav items and theme buttons from aside", { # Build an aside-like navbar with a container-fluid, collapse, ul with items and a theme li a_dropdown <- shiny::tags$a(href = "#", `data-bs-toggle` = "dropdown", "Menu") li_dd <- shiny::tags$li(class = "nav-item dropdown", a_dropdown) theme_a <- shiny::tags$a(href = "#", class = "theme-toggle", "Theme") theme_li <- shiny::tags$li(class = "mt-auto", shiny::tags$div(theme_a)) ul <- shiny::tags$ul(li_dd, 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 <- layout_fluid(aside_tag, NULL, tabler_body("BODY"), NULL) out_str <- as.character(out) # Dropdown should have aria-expanded and data-bs-auto-close set to false/outside in the produced nav_items expect_true(grepl('aria-expanded="false"|data-bs-auto-close="outside"', out_str)) # Body content must be present expect_true(grepl("BODY", out_str)) })