Skip to content

Commit b385981

Browse files
committed
Add a few visual tests
1 parent 19d8c84 commit b385981

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/testthat/test-labels.r

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,14 @@ test_that("Setting guide labels", {
2626
# American spelling
2727
expect_identical(labs(color = "my label")$colour, "my label")
2828
})
29+
30+
# Visual tests ------------------------------------------------------------
31+
32+
test_that("geom_violin draws correctly", {
33+
dat <- data.frame(x = 1:10, y = 10:1)
34+
p <- ggplot(dat, aes(x = x, y = y)) + geom_point() + labs(tag = "Fig. A)")
35+
36+
vdiffr::expect_doppelganger("defaults", p)
37+
vdiffr::expect_doppelganger("Other position", p + theme(plot.tag.position = 'bottom'))
38+
vdiffr::expect_doppelganger("Manual", p + theme(plot.tag.position = c(0.05, 0.05)))
39+
})

0 commit comments

Comments
 (0)