tests/testthat/test-UseNavigation.R

test_that("useNavigation() renders navigation state", {
  skip_on_cran()

  app <- shinytest2::AppDriver$new(
    app_dir = testthat::test_path("test-apps", "UseNavigation")
  )
  app$wait_for_idle()

  nav_state <- app$get_text("#navState")
  expect_equal(nav_state, "idle")

  nav_all <- app$get_text("#navAll")
  expect_true(grepl('"state"', nav_all))
  expect_true(grepl('"idle"', nav_all))
})

Try the reactRouter package in your browser

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

reactRouter documentation built on May 10, 2026, 5:07 p.m.