diff --git a/inTextSummaryTable/tests/testthat/test_subjectProfileSummaryPlot-general.R b/inTextSummaryTable/tests/testthat/test_subjectProfileSummaryPlot-general.R index 216f81a..a20cb64 100644 --- a/inTextSummaryTable/tests/testthat/test_subjectProfileSummaryPlot-general.R +++ b/inTextSummaryTable/tests/testthat/test_subjectProfileSummaryPlot-general.R @@ -21,15 +21,14 @@ test_that("The plot is correctly facetted based on a variable", { visit = c(1, 2, 1, 2), statMean = rnorm(4) ) - - expect_silent( - gg <- subjectProfileSummaryPlot( - data = summaryTable, - xVar = "visit", - facetVar = "PARAM" - ) + + gg <- subjectProfileSummaryPlot( + data = summaryTable, + xVar = "visit", + facetVar = "PARAM" ) - + expect_s3_class(gg, "ggplot2") + # check that the plots is facetted # and that facetted are ordered according to levels of factor ggData <- lapply(ggplot_build(gg)$data, `[`, c("x", "y", "PANEL")) diff --git a/inTextSummaryTable/tests/testthat/test_subjectProfileSummaryPlot-table.R b/inTextSummaryTable/tests/testthat/test_subjectProfileSummaryPlot-table.R index be07416..2e05707 100644 --- a/inTextSummaryTable/tests/testthat/test_subjectProfileSummaryPlot-table.R +++ b/inTextSummaryTable/tests/testthat/test_subjectProfileSummaryPlot-table.R @@ -352,12 +352,18 @@ test_that("The size of the points (in the legend) is correctly set", { colorVar = "TRT", pointSize = pointSize ) - - expect_equal( - object = gg$guides$colour$override.aes$size, - expected = pointSize - ) - + + if (!inherits(ggplot2::guide_none(), "Guide")) { + expect_equal( + object = gg$guides$colour$override.aes$size, + expected = pointSize + ) + } else { + expect_equal( + object = gg$guides$guides$colour$params$override.aes$size, + expected = pointSize + ) + } }) test_that("The variable labels are correctly extracted from the labels of all variables", {