Skip to content

Commit d18d316

Browse files
committed
TEST: scale_params "binned" mapping method
1 parent 549a383 commit d18d316

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/testthat/test-scale-colour-continuous.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ test_that("type argument is checked for proper input", {
1818
scale_colour_continuous(type = "abc")
1919
)
2020
})
21+
22+
test_that("scale_params mapping_method supports binned", {
23+
sc <- scale_fill_continuous()
24+
x <- seq(0, 1, length.out = 10)
25+
only_two <- sc$map(x, limits = c(0, 1), scale_params = list(mapping_method = "binned", mapping_method_bins = 2))
26+
expect_equal(length(unique(only_two)), 2L)
27+
})
28+

0 commit comments

Comments
 (0)