tests/testthat/test-f7Badge.R

context("f7Badge")

test_that("basic test", {
  badge <- f7Badge("mybadge")
  expect_true(inherits(badge, "shiny.tag"))
  expect_equal(badge$name, "span")
  expect_equal(badge$attribs$class, "badge")

  # with color
  badgeColor <- f7Badge("hello", color = "red")
  expect_equal(badgeColor$attribs$class, "badge color-red")
  expect_error(f7Badge("hello", color = "diamonds"))
})

Try the shinyMobile package in your browser

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

shinyMobile documentation built on Nov. 25, 2022, 5:05 p.m.