Skip to content

Commit bf1d378

Browse files
committed
get rid of variant snapshots
1 parent 274a59a commit bf1d378

File tree

7 files changed

+10
-38
lines changed

7 files changed

+10
-38
lines changed

R/theme.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ add_theme <- function(t1, t2, t2name, call = caller_env()) {
702702
return(t1)
703703
}
704704
if (!is.list(t2)) { # in various places in the code base, simple lists are used as themes
705-
cli::cli_abort("Can't add {.arg {t2name}} to a theme object.", call = call)
705+
cli::cli_abort("Can't add {.arg {t2name}} to a theme object.", call = NULL)
706706
}
707707

708708
# If t2 is a complete theme or t1 is NULL, just return t2

tests/testthat/_snaps/4.0/theme.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/testthat/_snaps/4.2/theme.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/testthat/_snaps/4.4/theme.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/testthat/_snaps/4.5/theme.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/testthat/_snaps/theme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# modifying theme element properties with + operator works
2+
3+
Code
4+
theme_grey() + "asdf"
5+
Condition
6+
Error:
7+
! Can't add `"asdf"` to a theme object.
8+
19
# theme validation happens at build stage
210

311
The `text` theme element must be a <element_text> object.

tests/testthat/test-theme.R

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ test_that("modifying theme element properties with + operator works", {
4949
t <- theme_grey() + theme()
5050
expect_identical(t, theme_grey())
5151

52-
expect_snapshot(
53-
theme_grey() + "asdf",
54-
error = TRUE,
55-
variant = substr(as.character(getRversion()), start = 1, stop = 3)
56-
)
52+
expect_snapshot(theme_grey() + "asdf", error = TRUE)
5753
})
5854

5955
test_that("adding theme object to ggplot object with + operator works", {

0 commit comments

Comments
 (0)