stRoke/tests/testthat/test-gt_plot.R

11 lines
293 B
R
Raw Normal View History

2023-01-12 13:44:29 +01:00
test_that("gt_plot() produces a valid ggplot object", {
2023-01-12 14:32:27 +01:00
require(webshot2)
2023-01-12 13:44:29 +01:00
x <- gt_plot(gtsummary::tbl_summary(mtcars))
expect_type(x, "list")
expect_true(inherits(x, c("gg", "ggplot")))
})
test_that("gt_plot() throws error if input is incorrect", {
expect_error(gt_plot(mtcars))
})