Skip to content

Commit

Permalink
TEST: scale_params "binned" mapping method
Browse files Browse the repository at this point in the history
  • Loading branch information
zeehio committed Nov 6, 2022
1 parent bba153e commit 3d394b0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/testthat/test-scale-colour-continuous.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ test_that("type argument is checked for proper input", {
scale_colour_continuous(type = "abc")
)
})

test_that("scale_params mapping_method supports binned", {
sc <- scale_fill_continuous()
x <- seq(0, 1, length.out = 10)
only_two <- sc$map(x, limits = c(0, 1), scale_params = list(mapping_method = "binned", mapping_method_bins = 2))
expect_equal(length(unique(only_two)), 2L)
})


0 comments on commit 3d394b0

Please sign in to comment.