Skip to content

Commit 1d3a845

Browse files
committed
add test
1 parent 6002c9f commit 1d3a845

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/testthat/_snaps/guide-legend.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# unresolved, modified expressions throw a warning (#6264)
2+
3+
Unable to apply legend modifications.
4+
Caused by error:
5+
! object 'prop' not found
6+

tests/testthat/test-guide-legend.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ test_that("legends can be forced to display unrelated geoms", {
136136
)
137137
})
138138

139+
test_that("unresolved, modified expressions throw a warning (#6264)", {
140+
p <- ggplot(mpg, aes(drv)) +
141+
geom_bar(
142+
aes(fill = stage(drv, after_scale = alpha(fill, prop)))
143+
)
144+
expect_snapshot_warning(ggplot_build(p))
145+
})
139146

140147
# Visual tests ------------------------------------------------------------
141148

0 commit comments

Comments
 (0)