Nothing
test_that("glassPage() creates a fillable bslib page with glasstabs", {
skip_if_not_installed("bslib")
page <- glassPage(shiny::h1("Hello"), title = "A glass app")
html <- as.character(page)
expect_s3_class(page, "shiny.tag.list")
expect_match(html, "Hello")
expect_identical(attr(page, "lang"), "en")
deps <- htmltools::findDependencies(page)
expect_true(any(vapply(deps, function(dep) dep$name == "glasstabs", logical(1))))
})
test_that("glassPage() accepts and validates the document language", {
skip_if_not_installed("bslib")
page <- glassPage(shiny::p("Bonjour"), lang = "fr-CA")
expect_identical(attr(page, "lang"), "fr-CA")
expect_error(
glassPage(lang = ""),
"single non-empty language tag",
class = "glasstabs_error_bad_argument"
)
})
test_that("glassPage() accepts a custom Bootstrap theme", {
skip_if_not_installed("bslib")
page <- glassPage(
shiny::p("Content"),
theme = bslib::bs_theme(version = 5, primary = "#2563eb"),
fillable_mobile = TRUE
)
expect_s3_class(page, "shiny.tag.list")
})
test_that("glassPage() gives useful argument errors", {
skip_if_not_installed("bslib")
expect_error(
glassPage(title = character()),
"single non-empty string or NULL",
class = "glasstabs_error_bad_argument"
)
expect_error(
glassPage(theme = "dark"),
"bslib theme",
class = "glasstabs_error_bad_theme"
)
expect_error(
glassPage(fillable_mobile = NA),
"must be.*TRUE.*FALSE",
class = "glasstabs_error_bad_argument"
)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.