context("test-r-plotvolume")
testthat::test_that("plotVolume plot is correctly constructed", {
df <- simData(25, 2)
p <- plotVolume(df)
expect_true(ggplot2::is.ggplot(p))
expect_equal(length(p$layers), 3)
expect_equal(p$labels$y, "Volume (kg)")
expect_equal(p$labels$title, "Volume per day")
geoms <- sapply(p$layers, function(x) class(x$geom)[1])
expect_equal(geoms, c("GeomPoint", "GeomLine", "GeomSmooth"))
# expect_equal(p$layers[[2]]$mapping$label, "Count")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.