@@ -43,22 +43,29 @@ test_that("ggplotly takes account of linebreaks in ticktext", {
43
43
expect_margin(L , gg , " long_ticktext" )
44
44
})
45
45
46
- # Linebreaks one category
47
- d <- data.frame (x = c(1 ), y = c(" ticktext\n long_ticktext\n ticktext" ))
48
- gg <- ggplot(d , aes(x , y )) + geom_bar(stat = " identity" )
49
-
50
46
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\n long_ticktext\n ticktext" ))
51
+ gg <- ggplot(d , aes(x , y )) + geom_bar(stat = " identity" )
52
+
51
53
# Visual Test
52
54
L <- expect_doppelganger_built(gg , " ticktext-linebreaks-one-cat" )
53
55
# ggplotly returns correct margin
54
56
expect_margin(L , gg , " long_ticktext" )
55
57
})
56
58
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
-
61
59
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
+
62
69
# Visual Test
63
70
L <- expect_doppelganger_built(gg , " ticktext-linebreaks-no-linebreaks" )
64
71
# ggplotly returns correct margin
0 commit comments