Skip to content

Commit 86ff33f

Browse files
jrwishartchschan
authored andcommitted
DS-4804 Allow test to work on earlier R versions
1 parent aee4d91 commit 86ff33f

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
@@ -359,16 +359,13 @@ test_that("group_by() on a plotly object doesn't produce warning", {
359359
})
360360

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

0 commit comments

Comments
 (0)