From 96f5cf45705bb409d24f7ff3da3801710168540c Mon Sep 17 00:00:00 2001 From: Melkiades Date: Fri, 28 Jun 2024 15:57:59 +0200 Subject: [PATCH] correct tests --- tests/testthat/test-g_lineplot.R | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-g_lineplot.R b/tests/testthat/test-g_lineplot.R index cc00cd9b15..15b2b264c4 100644 --- a/tests/testthat/test-g_lineplot.R +++ b/tests/testthat/test-g_lineplot.R @@ -158,7 +158,7 @@ testthat::test_that("g_lineplot works with no strata (group_var) and allows poin variables = control_lineplot_vars(group_var = NULL) ) ) - testthat::expect_true( + testthat::expect_false( # no group variable any( vapply( g_lineplot_no_strata$layers, function(x) { @@ -184,6 +184,23 @@ testthat::test_that("g_lineplot works with no strata (group_var) and allows poin ) ) ) + g_lineplot_single_strata <- withr::with_options( + opts_partial_match_old, + g_lineplot( + adlb2, + adsl2 + ) + ) + testthat::expect_true( # only one group variable + any( + vapply( + g_lineplot_single_strata$layers, function(x) { + any(grepl(class(x$geom), pattern = "line", ignore.case = TRUE)) + }, + logical(1L) + ) + ) + ) }) testthat::test_that("linetype works as well as col with manual scaling and other options (errorbar_width)", {