Skip to content

Commit 0a3021e

Browse files
committed
safer test code
1 parent 879a118 commit 0a3021e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/testthat/test-plotly-subplot.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ test_that("group + [x/y]axis works", {
3434
p <- plot_ly(iris, x = Petal.Length, y = Petal.Width, group = Species,
3535
xaxis = paste0("x", id), mode = "markers")
3636
s <- expect_traces(subplot(p, margin = 0.05), 3, "group")
37-
doms <- lapply(s$layout, "[[", "domain")
37+
ax <- s$layout[grepl("^[x-y]axis", names(s$layout))]
38+
doms <- lapply(ax, "[[", "domain")
3839
# make sure y domain is [0, 1] on every axis
3940
ydom <- doms[grepl("^y", names(doms))]
4041
expect_equal(sort(unique(unlist(ydom))), c(0, 1))

0 commit comments

Comments
 (0)