Skip to content

Commit b95fd2f

Browse files
committed
DS-4804 Allow test to work on earlier R versions
1 parent 39337c2 commit b95fd2f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/testthat/test-plotly.R

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -360,16 +360,13 @@ test_that("group_by() on a plotly object doesn't produce warning", {
360360
})
361361

362362
test_that("Check QTables dont cause errors", {
363-
.createQTableArray <- function(n, class.name)
364-
structure(
365-
array(runif(n), dim = n),
366-
class = class.name
367-
)
368363
s <- data.frame(
369-
x = .createQTableArray(10, "QTable"),
370-
x2 = .createQTableArray(10, "qTable"),
364+
x = array(runif(n), dim = n),
365+
x2 = array(runif(n), dim = n),
371366
y = factor(letters[1:10])
372367
)
368+
class(s[[1]]) <- "QTable"
369+
class(s[[2]]) <- "qTable"
373370
expect_error(p <- plot_ly(s) |>
374371
add_segments(x = ~x, xend = ~x2, y = ~y, yend = ~y, showlegend = FALSE) |>
375372
add_markers(x = ~x, xend = ~y, y = ~y, name = "foo", color = I("orange"), showlegend = FALSE) |>

0 commit comments

Comments
 (0)