File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -120,11 +120,13 @@ test_that("geom_sf() handles alpha properly", {
120120 g <- get_layer_grob(p )[[1 ]]
121121
122122 # alpha affects the colour of points and lines
123- expect_equal(g [[1 ]]$ gp $ col , alpha(red , 0.5 ))
124- expect_equal(g [[2 ]]$ gp $ col , alpha(red , 0.5 ))
123+ # geom_sf() will use `gList()` which is not a grob
124+ # and will be wrapped into a `gTree()`.
125+ expect_equal(g $ children [[1 ]]$ gp $ col , alpha(red , 0.5 ))
126+ expect_equal(g $ children [[2 ]]$ gp $ col , alpha(red , 0.5 ))
125127 # alpha doesn't affect the colour of polygons, but the fill
126- expect_equal(g [[3 ]]$ gp $ col , alpha(red , 1.0 ))
127- expect_equal(g [[3 ]]$ gp $ fill , alpha(red , 0.5 ))
128+ expect_equal(g $ children [[3 ]]$ gp $ col , alpha(red , 1.0 ))
129+ expect_equal(g $ children [[3 ]]$ gp $ fill , alpha(red , 0.5 ))
128130})
129131
130132test_that(" errors are correctly triggered" , {
You can’t perform that action at this time.
0 commit comments