tests/testthat/test-add_sparkline.R

test_that("add_sparkline() works", {
  tbl <-
    trial %>%
    dplyr::select(age, marker) %>%
    gtsummary::tbl_summary(missing = "always")

  expect_error(
    purrr::map(
      c("boxplot", "histogram", "rug_strip", "density", "sparkline"),
      ~ add_sparkline(tbl, type = .)
    ),
    NA
  )

  expect_error(
    tbl %>% add_sparkline(column_header = letters)
  )

})
ddsjoberg/bstfun documentation built on July 4, 2023, 10:59 a.m.