Skip to content

Commit 040b311

Browse files
committed
fix: value was 2 not 1 in main
1 parent 0b2967e commit 040b311

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

R/tm_missing_data.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,10 +716,11 @@ srv_missing_data <- function(id,
716716
n <- length(x)
717717
idx <- max(1, n - 10)
718718
prev_value <- isolate(input$combination_cutoff)
719-
value <- `if`(
720-
is.null(prev_value) || prev_value > max(x) || prev_value < min(x),
721-
sort(x, partial = idx)[idx], prev_value
722-
)
719+
value <- if (is.null(prev_value) || prev_value > max(x) || prev_value < min(x)) {
720+
sort(x, partial = idx)[idx]
721+
} else {
722+
prev_value
723+
}
723724

724725
teal.widgets::optionalSliderInputValMinMax(
725726
ns("combination_cutoff"),

tests/testthat/test-shinytest2-tm_misssing_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ test_that("e2e - tm_missing_data: Check default settings and visibility of the c
109109
)
110110
)
111111

112-
testthat::expect_equal(app_driver$get_active_module_input("iris-combination_cutoff"), 1L)
112+
testthat::expect_equal(app_driver$get_active_module_input("iris-combination_cutoff"), 2L)
113113
app_driver$set_active_module_input("iris-combination_cutoff", 10L)
114114
app_driver$expect_no_validation_error()
115115

0 commit comments

Comments
 (0)