Skip to content

Commit 9ac6a0d

Browse files
committed
expect_equivalent() expects classes to be the same
1 parent 661bc55 commit 9ac6a0d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/testthat/test-plotly-color.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ test_that("Mapping a numeric variable to color works", {
5656
idx <- vapply(l$data, is.colorbar, logical(1))
5757
markerScale <- l$data[[which(idx)]]$marker
5858
markerDat <- l$data[[which(!idx)]]$marker
59-
expect_equivalent(markerDat$color, iris$Petal.Width)
60-
expect_equivalent(markerScale$colorbar$title, "Petal.Width")
61-
expect_equivalent(min(iris$Petal.Width), markerScale$cmin)
62-
expect_equivalent(max(iris$Petal.Width), markerScale$cmax)
59+
expect_true(all(markerDat$color == iris$Petal.Width))
60+
expect_true(markerScale$colorbar$title == "Petal.Width")
61+
expect_true(min(iris$Petal.Width) == markerScale$cmin)
62+
expect_true(max(iris$Petal.Width) == markerScale$cmax)
6363
expect_true(all(0 <= markerScale$colorscale[,1] & markerScale$colorscale[,1] <= 1))
6464
})
6565

0 commit comments

Comments
 (0)