@@ -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\n long_ticktext\n ticktext" ))
48- gg <- ggplot(d , aes(x , y )) + geom_bar(stat = " identity" )
49-
5046test_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+
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-
6159test_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