tests/testthat/test-cookieBanner.R

test_that("cookie banner works", {

  cookieBannerCheck <- shinyGovstyle::cookieBanner("The best thing")

  cookieCheckChild <- cookieBannerCheck$children[[1]]

  expect_equal(
    length(cookieCheckChild$children[[2]]),
    3
  )

  expect_identical(
    cookieCheckChild$children[[1]]$children[[1]]$children[[1]]$children[[1]],
    "Cookies on The best thing"
  )

  expect_identical(
    cookieBannerCheck$children[[2]]$attribs[3]$class,
    "shinyjs-hide"
  )

  expect_identical(
    cookieBannerCheck$children[[3]]$attribs[3]$class,
    "shinyjs-hide"
  )

})

Try the shinyGovstyle package in your browser

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

shinyGovstyle documentation built on March 18, 2022, 7:24 p.m.