tests/testthat/test-set-background.R

context("set-background")

test_that("setBackgroundColor works", {

  tag <- setBackgroundColor()

  expect_is(tag, "shiny.tag")
  expect_length(tag$children, 1)

  tag <- setBackgroundColor(
    color = c("#F7FBFF", "#2171B5"),
    gradient = "linear",
    direction = "bottom"
  )

  expect_is(tag, "shiny.tag")
  expect_length(tag$children, 1)
})


test_that("setBackgroundImage works", {

  tag <- setBackgroundImage(src = "img/myimage.png")

  expect_is(tag, "shiny.tag")
  expect_length(tag$children, 1)

})

Try the shinyWidgets package in your browser

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

shinyWidgets documentation built on Aug. 30, 2023, 5:17 p.m.