tests/testthat/test-wa_breadcrumb.R

test_that("wa_breadcrumb defaults render the minimal wrapper", {
  expect_exact_html(
    render_html(
      shiny.webawesome:::wa_breadcrumb(
        shiny.webawesome:::wa_breadcrumb_item("Home")
      )
    ),
    c(
      "<wa-breadcrumb>",
      "  <wa-breadcrumb-item>Home</wa-breadcrumb-item>",
      "</wa-breadcrumb>"
    )
  )
})

test_that("wa_breadcrumb override render includes attrs and separator slot", {
  expect_exact_html(
    render_html(
      shiny.webawesome:::wa_breadcrumb(
        shiny.webawesome:::wa_breadcrumb_item("Home"),
        id = "breadcrumb",
        label = "Trail",
        separator = ">"
      )
    ),
    c(
      '<wa-breadcrumb id="breadcrumb" label="Trail">',
      "  <wa-breadcrumb-item>Home</wa-breadcrumb-item>",
      '  <span slot="separator">&gt;</span>',
      "</wa-breadcrumb>"
    )
  )
})

Try the shiny.webawesome package in your browser

Any scripts or data that you put into this service are public.

shiny.webawesome documentation built on April 22, 2026, 1:09 a.m.