Skip to content

Commit 7096402

Browse files
trekonomcpsievert
andauthored
Update tests/testthat/test-facet-axis.R
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
1 parent 6ca747d commit 7096402

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/testthat/test-facet-axis.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ test_that("ggplotly does not break discrete x-axis with facet_yyyy in panels > 1
55
facet_wrap(~pan)
66
L <- plotly_build(ggplotly(gp))
77
# tickvals, ticktext and categoryarray have class 'AsIs'
8-
expect_equal(class(L$x$layout$xaxis2$tickvals), "AsIs")
9-
expect_equal(class(L$x$layout$xaxis2$ticktext), "AsIs")
10-
expect_equal(class(L$x$layout$xaxis2$categoryarray), "AsIs")
8+
lapply(L$x$layout[c("xaxis", "xaxis2")], function(axis) {
9+
expect_s3_class(axis$tickvals, "AsIs")
10+
expect_s3_class(axis$ticktext, "AsIs")
11+
expect_true(axis$ticktext == "A")
12+
expect_s3_class(axis$categoryarray, "AsIs")
13+
expect_true(axis$categoryarray == "A")
14+
})
1115
})

0 commit comments

Comments
 (0)