tests/testthat/test-loaders.R

test_that("glanceLoaders() generates the correct HTML", {
  expect_snapshot(glanceLoaders())
})

test_that("loaders generates the correct HTML", {
  expect_snapshot(
    loaders(uiOutput = plotOutput("plot"),
            type = "default",
            style = "half",
            text = "Loading...")
    )
})

test_that("loaders generates the correct HTML when style is blink", {
  expect_snapshot(
    loaders(uiOutput = plotOutput("plot"),
            type = "default",
            style = "blink")
  )
})

test_that("loaders generates the correct HTML when style is inverse", {
  expect_snapshot(
    loaders(uiOutput = plotOutput("plot"),
            type = "default",
            style = "inverse")
  )
})

test_that("loaders generates the correct HTML when type is curtain", {
  expect_snapshot(
    loaders(uiOutput = plotOutput("plot"),
            type = "curtain",
            text = "Loading...")
  )
})

test_that("loaders generates the correct HTML when type is smartphone", {
  expect_snapshot(
    loaders(uiOutput = plotOutput("plot"),
            type = "smartphone",
            text = "Loading...")
  )
})

Try the standby package in your browser

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

standby documentation built on Oct. 30, 2024, 9:30 a.m.