We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7f09db commit 9d5840fCopy full SHA for 9d5840f
tests/testthat/test-ggplot-facets.R
@@ -97,3 +97,27 @@ test_that("facet_wrap() doesn't create interior scales", {
97
info <- save_outputs(g, "facet_wrap")
98
expect_equal(unique(unlist(lapply(info$data, "[[", "yaxis"))), "y")
99
})
100
+
101
102
+g <- ggplot(mtcars, aes(mpg, wt)) +
103
+ geom_point() +
104
+ facet_wrap( ~ am, labeller = label_both)
105
106
+test_that("facet_wrap translates simple labeller function", {
107
+ info <- save_outputs(g, "facet_wrap-labeller")
108
+ txt <- sapply(info$layout$annotations, "[[", "text")
109
+ expect_true(all(c("am: 0", "am: 1") %in% txt))
110
+})
111
112
113
114
+ facet_grid(vs ~ am, labeller = label_both)
115
116
+test_that("facet_grid translates simple labeller function", {
117
+ info <- save_outputs(g, "facet_grid-labeller")
118
119
+ expect_true(
120
+ all(c("am: 0", "am: 1", "vs: 0", "vs: 1") %in% txt)
121
+ )
122
123
0 commit comments