tests/testthat/test-use_theme.R

test_that("use_theme works with file", {
  tag <- use_theme(theme = "theme.css")
  expect_is(tag, "shiny.tag")
  expect_identical(tag$children[[1]]$attribs$href, "theme.css")
})


test_that("use_theme works with inline css", {
  tag <- use_theme(create_theme(
    theme = "default",
    bs_vars_global(
      body_bg = "#000",
      text_color = "#FFF"
    ),
    bs_vars_wells(
      bg = "#2E2E2E"
    )
  ))
  expect_is(tag, "shiny.tag")
  expect_identical(tag$children[[1]]$name, "style")
})

Try the fresh package in your browser

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

fresh documentation built on June 26, 2024, 5:06 p.m.