Skip to content

Commit 9a3c839

Browse files
committed
Skip more
1 parent 1ec4635 commit 9a3c839

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

tests/testthat/test-ticktext-linebreaks.R

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,29 @@ test_that("ggplotly takes account of linebreaks in ticktext", {
4343
expect_margin(L, gg, "long_ticktext")
4444
})
4545

46-
# Linebreaks one category
47-
d <- data.frame(x = c(1), y = c("ticktext\nlong_ticktext\nticktext"))
48-
gg <- ggplot(d, aes(x, y)) + geom_bar(stat = "identity")
49-
5046
test_that("ggplotly takes account of linebreaks in ticktext with only one category", {
47+
testthat::skip_if_not(getRversion() >= "4.3.0")
48+
49+
# Linebreaks one category
50+
d <- data.frame(x = c(1), y = c("ticktext\nlong_ticktext\nticktext"))
51+
gg <- ggplot(d, aes(x, y)) + geom_bar(stat = "identity")
52+
5153
# Visual Test
5254
L <- expect_doppelganger_built(gg, "ticktext-linebreaks-one-cat")
5355
# ggplotly returns correct margin
5456
expect_margin(L, gg, "long_ticktext")
5557
})
5658

57-
# No linebreaks
58-
d <- data.frame(x = c(1, 2, 3), y = c("ticktext long_ticktext ticktext", "ticktext", "ticktext"))
59-
gg <- ggplot(d, aes(x, y)) + geom_bar(stat = "identity")
60-
6159
test_that("ggplotly works with no linebreaks in ticktext", {
60+
testthat::skip_if_not(getRversion() >= "4.3.0")
61+
62+
# No linebreaks
63+
d <- data.frame(
64+
x = c(1, 2, 3),
65+
y = c("ticktext long_ticktext ticktext", "ticktext", "ticktext")
66+
)
67+
gg <- ggplot(d, aes(x, y)) + geom_bar(stat = "identity")
68+
6269
# Visual Test
6370
L <- expect_doppelganger_built(gg, "ticktext-linebreaks-no-linebreaks")
6471
# ggplotly returns correct margin

0 commit comments

Comments
 (0)