test_that("theme functions work", {
expect_s3_class(theme_blab(), "theme")
expect_s3_class(theme_spooky(), "theme")
expect_s3_class(theme_AMERICA(), "theme")
})
test_that("theme function result in the same plot as before", {
# TODO: Add relevant elements to this plot. It doesn't have many that the
# themes affect
histogram <- ggplot2::ggplot(mtcars, ggplot2::aes(disp)) +
ggplot2::geom_histogram(bins = 30)
vdiffr::expect_doppelganger("plot with theme_blab", histogram + theme_blab())
vdiffr::expect_doppelganger("plot with theme_spooky",
histogram + theme_spooky())
vdiffr::expect_doppelganger("plot with theme_AMERICA",
histogram + theme_AMERICA())
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.