Skip to content

Commit 71be0cd

Browse files
committed
add some tests
1 parent 3e83136 commit 71be0cd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/testthat/test-ggplot-facets.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ test_that("6 facets becomes 6 panels", {
77
theme_bw() +
88
theme(panel.margin = grid::unit(0, "cm"))
99
info <- save_outputs(gg, "barley")
10+
# two legend entries, but two groups
11+
expect_equal(sum(sapply(l$data, "[[", "showlegend")), 2)
12+
expect_identical(
13+
sort(unique(sapply(l$data, "[[", "legendgroup"))), c("1931", "1932")
14+
)
15+
expect_identical(
16+
sort(unique(sapply(l$data, "[[", "name"))), c("1931", "1932")
17+
)
1018
})
1119

1220
test_that("3 facets becomes 3 panels", {

0 commit comments

Comments
 (0)