Skip to content

Commit efd83ad

Browse files
committed
Add unit test for strip clipping
1 parent 2c061c1 commit efd83ad

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/testthat/test-facet-strips.r

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,16 @@ test_that("y strip labels are rotated when strips are switched", {
138138

139139
expect_doppelganger("switched facet strips", switched)
140140
})
141+
142+
test_that("strip clipping can be set from the theme", {
143+
labels <- data_frame(var1 = "a")
144+
145+
strip <- render_strips(labels, labeller = label_value,
146+
theme = theme_test() + theme(strip.clip = "on"))
147+
expect_equal(strip$x$top[[1]]$layout$clip, "on")
148+
149+
strip <- render_strips(labels, labeller = label_value,
150+
theme = theme_test() + theme(strip.clip = "off"))
151+
expect_equal(strip$x$top[[1]]$layout$clip, "off")
152+
})
153+

0 commit comments

Comments
 (0)