Skip to content

Commit b871f0d

Browse files
Fix a test expectation
1 parent 43d12b1 commit b871f0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/testthat/test-aes-setting.r

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ test_that("alpha affects only fill colour of solid geoms", {
3232
geom_polygon(fill = "red", colour = "red", alpha = 0.5)
3333
rect <- ggplot(df, aes(xmin = x, xmax = x + 1, ymin = 1, ymax = y + 1)) +
3434
geom_rect(fill = "red", colour = "red", alpha = 0.5)
35+
# geom_ribbon() consists of polygonGrob and polylineGrob
3536
ribb <- ggplot(df, aes(x = x, ymin = 1, ymax = y + 1)) +
3637
geom_ribbon(fill = "red", colour = "red", alpha = 0.5)
3738

3839
expect_equal(layer_grob(poly)[[1]]$gp$col[[1]], "red")
3940
expect_equal(layer_grob(rect)[[1]]$gp$col[[1]], "red")
40-
expect_equal(layer_grob(ribb)[[1]]$children[[1]]$gp$col[[1]], "red")
41+
expect_equal(layer_grob(ribb)[[1]]$children[[1]]$children[[2]]$gp$col[[1]], "red")
4142

4243
expect_equal(layer_grob(poly)[[1]]$gp$fill[[1]], "#FF000080")
4344
expect_equal(layer_grob(rect)[[1]]$gp$fill[[1]], "#FF000080")
44-
expect_equal(layer_grob(ribb)[[1]]$children[[1]]$gp$fill[[1]], "#FF000080")
45+
expect_equal(layer_grob(ribb)[[1]]$children[[1]]$children[[1]]$gp$fill[[1]], "#FF000080")
4546
})

0 commit comments

Comments
 (0)