Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with ggplot2 3.6.0 #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/testthat/test_plot.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ context("Testing plotting... to the extent possible")
test_that("dotplot works produces a plot", {
p <- dotplot(ali_pafr)
expect_is(p, "ggplot")
labs <- unlist(p[["labels"]])
expect_equal(unname(labs["x"]), "concat_qstart")
labs <- if ("get_labs" %in% getNamespaceExports("ggplot2")) {
unlist(ggplot2::get_labs(p))
} else {
unlist(p$labels)
}
# expect_equal(unname(labs["x"]), "concat_qstart")
expect_equal(unname(labs["xend"]), "concat_qend")
expect_equal(unname(labs["y"]), "concat_tstart")
# expect_equal(unname(labs["y"]), "concat_tstart")
Comment on lines +11 to +13
Copy link
Author

@teunbrand teunbrand Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are commented out because the new version reports the labels generated by the scales (instead of just those in the $labels slot) and aren't the same across versions. Visually, the plot is the same though.

expect_equal(unname(labs["yend"]), "concat_tend")
expect_equal(unname(labs["xintercept"]), "xintercept")
expect_equal(unname(labs["yintercept"]), "yintercept")
Expand Down