Skip to content

Commit 1061200

Browse files
committed
add test
1 parent 1120686 commit 1061200

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/testthat/test-labels.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ test_that("Labels from static aesthetics are ignored (#6003)", {
8383
expect_null(get_labs(p)$colour)
8484
})
8585

86+
test_that("Labels from annotations are ignored (#6316)", {
87+
df <- data.frame(a = 1, b = 2)
88+
p <- ggplot(df, aes(a, b)) + annotate("point", x = 1, y = 2) + geom_point()
89+
labs <- get_labs(p)
90+
expect_equal(labs[c("x", "y")], list(x = "a", y = "b"))
91+
})
92+
8693
test_that("alt text is returned", {
8794
p <- ggplot(mtcars, aes(mpg, disp)) +
8895
geom_point()

0 commit comments

Comments
 (0)