Skip to content

Commit 6a4484d

Browse files
committed
Add alpha test for geom_ribbon
1 parent 5eec8c4 commit 6a4484d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/testthat/test-ggplot-ribbon.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ test_that("sanity check for geom_ribbon", {
1414
})
1515

1616
save_outputs(rb, "ribbon")
17+
18+
rb2 <- ggplot(huron, aes(x=year)) +
19+
geom_ribbon(aes(ymin=level-1, ymax=level+1), alpha = 0.1)
20+
L2 <- gg2list(rb2)
21+
22+
test_that("geom_ribbon respects alpha transparency", {
23+
expect_true(grepl("0.1\\)$", L2[[1]]$fillcolor))
24+
})
25+
26+
save_outputs(rb2, "ribbon-alpha")

0 commit comments

Comments
 (0)