tests/testthat/test-tag.R

test_that("tag works", {

  tag_check <- shinyGovstyle::tag_Input("tag1", "COMPLETE")
  expect_identical(
    tag_check$children[[1]],
    "COMPLETE"
  )

  expect_identical(
    tag_check$attribs$class,
    "govuk-tag"
  )

})


test_that("tag colour works", {

  tag_check2 <- shinyGovstyle::tag_Input("tag1", "COMPLETE", "yellow")

  expect_identical(
    tag_check2$attribs$class,
    "govuk-tag govuk-tag--yellow"
  )

})

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.