Skip to content

Commit ab93d71

Browse files
teunbrandjdhoffa
andauthored
adapt test (#575)
Co-authored-by: Jackson Hoffart <[email protected]>
1 parent df5a612 commit ab93d71

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/testthat/test-plot_trajectory.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,14 @@ test_that("outputs default axis labels", {
3737
data <- prep_trajectory(example_market_share())
3838
p <- plot_trajectory(data)
3939

40-
expect_equal(p$labels$x, "year")
41-
expect_equal(p$labels$y, "value")
40+
labels <- if ("get_labs" %in% getNamespaceExports("ggplot2")) {
41+
ggplot2::get_labs(p)
42+
} else {
43+
p$labels
44+
}
45+
46+
expect_equal(labels$x, "year")
47+
expect_equal(labels$y, "value")
4248
})
4349

4450
test_that("By default doesn't center the Y axis", {

0 commit comments

Comments
 (0)