tests/testthat/test-r-plotvolume.R

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")
})
MarijnJABoer/HeavySetR documentation built on May 22, 2019, 5:31 p.m.