Skip to content

Commit 7db57c8

Browse files
committed
fix test expectations
1 parent 6791e4f commit 7db57c8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/testthat/test-plotly-sf.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ test_that("sizing constants", {
240240
p <- plot_mapbox(mn_pts, size = I(30)) %>% plotly_build()
241241
d <- p$x$data
242242
expect_length(d, 1)
243-
expect_true(d[[1]]$marker$size == 30)
243+
expect_true(all(d[[1]]$marker$size == 30))
244244
expect_true(d[[1]]$marker$sizemode == "area")
245245

246246
# span controls marker.line.width
247247
p <- plot_ly(mn_pts, size = I(30), span = I(10), stroke = I("black")) %>% plotly_build()
248248
d <- p$x$data
249249
expect_length(d, 1)
250-
expect_true(d[[1]]$marker$size == 30)
250+
expect_true(all(d[[1]]$marker$size == 30))
251251
expect_true(d[[1]]$marker$sizemode == "area")
252252
expect_true(d[[1]]$marker$line$width == 10)
253253
expect_true(d[[1]]$marker$line$color == toRGB("black"))
@@ -256,7 +256,7 @@ test_that("sizing constants", {
256256
p <- plot_ly(mn_pts, size = I(20), error_x = list(value = 5)) %>% plotly_build()
257257
d <- p$x$data
258258
expect_length(d, 1)
259-
expect_true(d[[1]]$marker$size == 20)
259+
expect_true(all(d[[1]]$marker$size == 20))
260260
expect_true(d[[1]]$marker$sizemode == "area")
261261
expect_true(d[[1]]$error_x$value == 5)
262262
expect_true(d[[1]]$error_x$width == 20)

tests/testthat/test-plotly-size.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ test_that("sizemode is always respected", {
2222
test_that("size maps correctly to marker.size", {
2323
p <- plot_ly(x = 1:10, y = 1:10, size = I(30))
2424
d <- expect_doppelganger_built(p, "marker.size")$data
25-
expect_equivalent(d[[1]]$marker$size, rep(30, 10))
25+
expect_true(all(d[[1]]$marker$size == 30))
2626
})

0 commit comments

Comments
 (0)