Skip to content

Commit

Permalink
Disable snapshot tests that differ over versions
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Dec 21, 2023
1 parent cbef974 commit a49e905
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 543 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ggh4x (development version)

* Anticipatory changes for ggplot2 3.5.0.
* `force_panelsizes()` can now take 'bigpts' units as `total_width` or `total_height`
arguments (#118)
* Fixed bug in `facet_nested()` when `margins = TRUE` (#121)
Expand Down
184 changes: 0 additions & 184 deletions tests/testthat/_snaps/facet_manual/no-removable-whitespace.svg

This file was deleted.

250 changes: 0 additions & 250 deletions tests/testthat/_snaps/facet_manual/removable-whitespace.svg

This file was deleted.

10 changes: 0 additions & 10 deletions tests/testthat/_snaps/guide_axis_logticks.md

This file was deleted.

10 changes: 0 additions & 10 deletions tests/testthat/_snaps/guide_axis_minor.md

This file was deleted.

10 changes: 0 additions & 10 deletions tests/testthat/_snaps/guide_axis_nested.md

This file was deleted.

21 changes: 0 additions & 21 deletions tests/testthat/test-facet_manual.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,3 @@ test_that("facet_manual can assume layouts", {
})

# Visual tests ------------------------------------------------------------

test_that("whitespace is removed in appropriate places", {

p <- ggplot(mtcars, aes(mpg, disp)) + geom_point()

design <- matrix(c(1,1,NA,NA,NA,2,2,NA,NA,NA,3,3), 4, 3)

vdiffr::expect_doppelganger(
"No removable whitespace",
p + facet_manual(vars(cyl), design = design)
)

design <- matrix(c(1,3,NA,NA,4,6,NA,4,6,2,5,NA), 3, 4)

vdiffr::expect_doppelganger(
"Removable whitespace",
p + facet_manual(vars(carb), design = design)
)
})


19 changes: 0 additions & 19 deletions tests/testthat/test-guide_axis_logticks.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,3 @@ test_that("NULL breaks return zeroGrob as labels", {
expect_s3_class(g, "zeroGrob")
})

test_that("guide_axis_logticks errors upon misuse", {
rlang::local_options(lifecycle_verbosity = "quiet")

g <- ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
geom_point(aes(colour = Species)) +
scale_colour_discrete(guide = "axis_logticks")

if (!new_guide_system) {
expect_snapshot_error(ggplotGrob(g))
} else {
expect_snapshot_warning(ggplotGrob(g))
}

gui <- guide_axis_logticks()
gui$available_aes <- "z"

g <- base + scale_x_continuous(guide = gui)
expect_snapshot_warning(ggplotGrob(g))
})
21 changes: 0 additions & 21 deletions tests/testthat/test-guide_axis_minor.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,3 @@ test_that("NULL breaks return zeroGrob as labels", {
g <- g$grobs[[which(g$layout$name == "axis-b")]]$children[[1]]
expect_s3_class(g, "zeroGrob")
})

test_that("guide_axis_minor errors upon misuse", {
rlang::local_options(lifecycle_verbosity = "quiet")

g <- ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
geom_point(aes(colour = Species)) +
scale_colour_discrete(guide = "axis_minor")

if (!new_guide_system) {
expect_snapshot_error(ggplotGrob(g))
} else {
expect_snapshot_warning(ggplotGrob(g))
}


gui <- guide_axis_minor()
gui$available_aes <- "z"

g <- base + scale_x_continuous(guide = gui)
expect_snapshot_warning(ggplotGrob(g))
})
18 changes: 0 additions & 18 deletions tests/testthat/test-guide_axis_nested.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,6 @@ test_that("guide_axis_nested works as secundary y-axis", {
expect_true(all(large %in% unique(mpg$class)))
})

test_that("guide_axis_nested errors upon misuse", {
rlang::local_options(lifecycle_verbosity = "quiet")
base <- ggplot(mpg, aes(interaction(cyl, class), hwy)) +
geom_boxplot(aes(fill = class))
g <- base + scale_fill_discrete(guide = "axis_nested")
if (!new_guide_system) {
expect_snapshot_error(ggplotGrob(g))
} else {
expect_snapshot_warning(ggplotGrob(g))
}

gui <- guide_axis_nested()
gui$available_aes <- "z"

g <- base + scale_x_discrete(guide = gui)
expect_snapshot_warning(ggplotGrob(g))
})

test_that("NULL breaks return zeroGrob as labels", {
rlang::local_options(lifecycle_verbosity = "quiet")
g <- ggplot(mpg, aes(interaction(cyl, class), hwy)) +
Expand Down

0 comments on commit a49e905

Please sign in to comment.