tests/testthat/test-fullscreen_all.R

test_that("fullscreen_all needs a click_id argument", {
  expect_error(fullscreen_all())
})

test_that("fullscreen_all produces the right JS", {
  shiny::actionButton("click", "Click") %>%
    fullscreen_all() %>%
    paste() %>%
    gsub("\\t", "", .) %>%
    gsub("\\n", "", .) %>%
    # remove additional spaces
    gsub("(?<=[\\s])\\s*|^\\s+|\\s+$", "", ., perl = TRUE) %>%
    expect_snapshot_output()
})

test_that("argument bg_color works", {

  shiny::actionButton("click", "Click") %>%
    fullscreen_all(bg_color = "pink") %>%
    paste() %>%
    gsub("\\t", "", .) %>%
    gsub("\\n", "", .) %>%
    # remove additional spaces
    gsub("(?<=[\\s])\\s*|^\\s+|\\s+$", "", ., perl = TRUE) %>%
    expect_snapshot_output()
})

Try the shinyfullscreen package in your browser

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

shinyfullscreen documentation built on Jan. 16, 2021, 5:17 p.m.