From 3d394b00f0a9f45494ffa7336d141043f54dcfe8 Mon Sep 17 00:00:00 2001 From: Sergio Oller Date: Sun, 6 Nov 2022 12:01:48 +0100 Subject: [PATCH] TEST: scale_params "binned" mapping method --- tests/testthat/test-scale-colour-continuous.R | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/testthat/test-scale-colour-continuous.R b/tests/testthat/test-scale-colour-continuous.R index 10e3ae4dd5..a3b4f78c60 100644 --- a/tests/testthat/test-scale-colour-continuous.R +++ b/tests/testthat/test-scale-colour-continuous.R @@ -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) +}) + +