Skip to content

Commit

Permalink
Use new location of guides (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand authored Jul 7, 2023
1 parent c1c8aab commit 7fbba10
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/testthat/test-gghighlight.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ test_that("gghighlight() works with the plot with one layer, grouped", {
p_highlighted <- p + gghighlight(mean(value) > 1, use_direct_label = FALSE)
expect_equal(p_highlighted$data, d_sieved)
expect_equal_layers(p_highlighted$layers, list(l_bleached, l_sieved))
expect_equal(p_highlighted$guides, NULL)
if (utils::packageVersion("ggplot2") <= "3.4.2") {
expect_equal(p_highlighted$guides, NULL)
} else {
expect_equal(p_highlighted$guides$guides, NULL)
}
}

# with labels
Expand All @@ -78,7 +82,11 @@ test_that("gghighlight() works with the plot with one layer, grouped", {
p_highlighted <- p + gghighlight(mean(value) > 1, use_direct_label = TRUE)
expect_equal(p_highlighted$data, d_sieved)
expect_equal_layers(p_highlighted$layers, list(l_bleached, l_sieved, l_label))
expect_equal(p_highlighted$guides, list(colour = "none", fill = "none"))
if (utils::packageVersion("ggplot2") <= "3.4.2") {
expect_equal(p_highlighted$guides, list(colour = "none", fill = "none"))
} else {
expect_equal(p_highlighted$guides$guides, list(colour = "none", fill = "none"))
}
}
})

Expand Down

0 comments on commit 7fbba10

Please sign in to comment.