Skip to content

Commit

Permalink
stabilise tests
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Jan 31, 2025
1 parent e291d95 commit 647d858
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/testthat/test-model_tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ test_that("cug plot works", {
expect_s3_class(cugplot$layers[[1]], "ggproto")
expect_s3_class(cugplot$layers[[1]]$geom, "GeomDensity")
expect_s3_class(cugplot$layers[[1]]$stat, "StatDensity")
expect_identical(cugplot$labels$x, "Statistic")
expect_identical(cugplot$labels$y, "Density")
labels <- if ("get_labs" %in% getNamespaceExports("ggplot2")) {
ggplot2::get_labs(cugplot)
} else {
cugplot$labels
}
expect_identical(labels$x, "Statistic")
expect_identical(labels$y, "Density")
})

qapplot <- plot(qaptest)
Expand All @@ -70,6 +75,11 @@ test_that("qap plot works", {
expect_s3_class(qapplot$layers[[1]], "ggproto")
expect_s3_class(qapplot$layers[[1]]$geom, "GeomDensity")
expect_s3_class(qapplot$layers[[1]]$stat, "StatDensity")
expect_identical(qapplot$labels$x, "Statistic")
expect_identical(qapplot$labels$y, "Density")
labels <- if ("get_labs" %in% getNamespaceExports("ggplot2")) {
ggplot2::get_labs(cugplot)
} else {
cugplot$labels
}
expect_identical(labels$x, "Statistic")
expect_identical(labels$y, "Density")
})

0 comments on commit 647d858

Please sign in to comment.