From 7d2b245429491515d78c8c0bfb5e562a08f51962 Mon Sep 17 00:00:00 2001 From: Sanne Govaert <44606923+sannegovaert@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:39:53 +0100 Subject: [PATCH] add test for new notification --- tests/testthat/test-merge_camtrapdp.R | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/testthat/test-merge_camtrapdp.R b/tests/testthat/test-merge_camtrapdp.R index b0075148..68588f45 100644 --- a/tests/testthat/test-merge_camtrapdp.R +++ b/tests/testthat/test-merge_camtrapdp.R @@ -8,6 +8,20 @@ test_that("merge_camtrapdp() returns a valid camtrapdp object", { expect_no_error(check_camtrapdp(merge_camtrapdp(x, y))) }) +test_that("merge_camtrapdp() returns alert on non-identical samplingDesign", { + skip_if_offline() + x <- example_dataset() + x$name <- "x" + y <- x + y$name <- "y" + y$project$samplingDesign <- "opportunistic" + + expect_message( + merge_camtrapdp(x, y), + class = "camtrapdp_alert_sampligndesign_ignored" + ) +}) + test_that("merge_camtrapdp() returns error on missing/invalid/duplicate dataset name(s)", { skip_if_offline()