Skip to content

Commit 970e9fd

Browse files
committed
add a test
1 parent fbcf391 commit 970e9fd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/testthat/test-plotly.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,18 @@ test_that("Can map data to legendgroup", {
280280
expect_true(bars[[i]]$legendgroup == letters[[i]])
281281
}
282282
})
283+
284+
285+
test_that("Axis domains aren't supplied if layout.grid exists", {
286+
p <- plot_ly(type = 'scatter',mode = 'lines', y = c(5,1,3), xaxis = 'x', yaxis = 'y') %>%
287+
add_trace(y = c(2,1,5), xaxis = 'x2', yaxis = 'y2') %>%
288+
add_trace(y = c(2,1,5), xaxis = 'x3', yaxis = 'y3')%>%
289+
add_trace(y = c(2,1,5), xaxis = 'x4', yaxis = 'y4')%>%
290+
add_trace(y = c(2,1,5), xaxis = 'x5', yaxis = 'y5')%>%
291+
add_trace(y = c(2,1,5), xaxis = 'x6', yaxis = 'y6')%>%
292+
layout(grid = list(rows = 2, columns = 3, pattern ='independent'))
293+
294+
l <- expect_doppelganger_built(p, "layout-grid")
295+
expect_null(l$layout$xaxis$domain)
296+
expect_null(l$layout$yaxis$domain)
297+
})

0 commit comments

Comments
 (0)