@@ -32,20 +32,22 @@ test_that("geom_ribbon() creates 1 trace & respects alpha transparency", {
32
32
p2 <- ggplot(data = huron , aes(group = factor (decade ))) +
33
33
geom_ribbon(aes(x = diff , ymin = level - 0.1 , ymax = level + 0.1 ))
34
34
35
- test_that(" geom_ribbon() group aesthetic" , {
35
+ test_that(" geom_ribbon() with group aesthetic produces 1 trace " , {
36
36
info <- expect_traces(p2 , 1 , " group" )
37
37
})
38
38
39
39
p3 <- ggplot(data = huron , aes(colour = factor (decade ))) +
40
40
geom_ribbon(aes(x = diff , ymin = level - 0.1 , ymax = level + 0.1 ))
41
41
42
- test_that(" geom_ribbon() colour aesthetic" , {
43
- info <- expect_traces(p3 , 1 , " colour" )
42
+ test_that(" geom_ribbon() with colour aesthetic produces multiple traces" , {
43
+ # 10 traces -- one for each decade
44
+ info <- expect_traces(p3 , 10 , " colour" )
44
45
})
45
46
46
47
p4 <- ggplot(data = huron , aes(fill = factor (decade ))) +
47
48
geom_ribbon(aes(x = diff , ymin = level - 0.1 , ymax = level + 0.1 ))
48
49
49
- test_that(" geom_ribbon() fill aesthetic" , {
50
- info <- expect_traces(p4 , 1 , " fill" )
50
+ test_that(" geom_ribbon() with fill aesthetic produces multiple traces" , {
51
+ # 10 traces -- one for each decade
52
+ info <- expect_traces(p4 , 10 , " fill" )
51
53
})
0 commit comments