Skip to content

Commit a13e927

Browse files
committed
Add test for number of legend entries
1 parent 18192a5 commit a13e927

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/testthat/test-ggplot-smooth.R

+2
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,7 @@ p8 <- qplot(carat, price, data = d) + facet_wrap(~cut) +
6363
test_that("geom_smooth() works with facets", {
6464
# 3 traces for each panel
6565
info <- expect_traces(p8, 15, "facet")
66+
n <- sum(unlist(sapply(info$traces, "[[", "showlegend")))
67+
expect_equal(n, nlevels(d$cut))
6668
})
6769

0 commit comments

Comments
 (0)