tests/testthat/test-plot_check_temp.R

test_that("plot_check_temp() works", {
  p <- plot_check_temp(crooked_river, date, temp_c)
  expect_type(p, "list")
  expect_s3_class(p, "gg")
  plot_names <- names(p)
  expect_identical(plot_names, c(
    "data", "layers", "scales", "guides",
    "mapping", "theme", "coordinates",
    "facet", "plot_env", "layout", "labels"
  ))
  expect_s3_class(p$data, "data.frame")
  plot_geoms <- sapply(p$layers, function(x) class(x$geom)[1])
  expect_identical(plot_geoms, c("GeomPoint", "GeomLine", "GeomHline", "GeomHline"))
  expect_invisible(plot(p))
})

Try the hatchR package in your browser

Any scripts or data that you put into this service are public.

hatchR documentation built on April 3, 2025, 7:54 p.m.