Merge pull request #23 from teunbrand/ggplot2_360
Compatibility with ggplot2 3.6.0
diff --git a/tests/testthat/test-misc.R b/tests/testthat/test-misc.R
index de9b266..c87dea4 100644
--- a/tests/testthat/test-misc.R
+++ b/tests/testthat/test-misc.R
@@ -221,6 +221,11 @@
)
gpt <- df %>% ggplot(aes(year, ipm, fill = condition, color = condition)) +
geom_freq_by_year_ci()
- expect_equal(gpt[["labels"]][["url"]], "webUIRequestUrl")
+ labels <- if ("get_labs" %in% getNamespaceExports("ggplot2")) {
+ ggplot2::get_labs(gpt)
+ } else {
+ gpt[["labels"]]
+ }
+ expect_equal(labels[["url"]], "webUIRequestUrl")
expect_equal(gpt[["data"]][["query"]][14], "[tt/l=Heuschrecke]")
})