test_that("layout_navbar_sticky converts aside to sticky header and sets dropdown attrs", { # construct an aside with a dropdown and a theme toggle a_dropdown <- shiny::tags$a(href = "#", `data-bs-toggle` = "dropdown", "Drop") li_dd <- shiny::tags$li(class = "nav-item", 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_navbar_sticky(aside_tag, NULL, tabler_body("BODY"), NULL) s <- as.character(out) expect_true(grepl('aria-expanded="false"', s)) expect_true(grepl('data-bs-auto-close="outside"', s)) expect_true(grepl("BODY", s)) })