Skip to content
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

@teunbrand teunbrand Jan 31, 2025

Copy link
Copy Markdown
Author

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