Skip to content

Commit 679f33f

Browse files
committed
add test
1 parent b554bdd commit 679f33f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/testthat/test-plotly-symbol.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,12 @@ test_that("Warn about invalid symbol codes", {
3737
p <- plot_ly(iris, x = ~Sepal.Length, y = ~Petal.Length, symbol = I("DNE"))
3838
expect_warning(plotly_build(p), "DNE")
3939
})
40+
41+
test_that("Formula resulting in logical vector works", {
42+
s <- c("triangle-up", "circle-open")
43+
p <- plot_ly(x = 1:10, y = 1:10, symbol = ~1:10 > 5, symbols = s)
44+
l <- expect_traces(p, 2, "logical")
45+
markers <- lapply(l$data, "[[", "marker")
46+
syms <- unlist(lapply(markers, "[[", "symbol"))
47+
expect_identical(syms, s)
48+
})

0 commit comments

Comments
 (0)