Skip to content

Commit afa0d44

Browse files
committed
TEST: scale_params "binned" mapping method
1 parent 8e365c0 commit afa0d44

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
@@ -47,3 +47,11 @@ test_that("palette with may_return_NA=FALSE works as expected", {
4747
nat <- sc$map(0.5, limits = c(0, 1))
4848
expect_equal(nat, NA_character_)
4949
})
50+
51+
test_that("scale_params mapping_method supports binned", {
52+
sc <- scale_fill_continuous()
53+
x <- seq(0, 1, length.out = 10)
54+
only_two <- sc$map(x, limits = c(0, 1), scale_params = list(mapping_method = "binned", mapping_method_bins = 2))
55+
expect_equal(length(unique(only_two)), 2L)
56+
})
57+

0 commit comments

Comments
 (0)