## Tests for all inputs:
# shiny::checkboxInput
# shiny::checkboxGroupInput
# shiny::dateInput
# shiny::dateRangeInput
# shiny::fileInput
# shiny::numericInput
# X shiny::passwordInput
# shiny::radioButtons
# X shiny::selectInput
# X shiny::selectizeInput
# X shiny::sliderInput
# X shiny::snapshotPreprocessInput
# shiny::textInput
# X shiny::textAreaInput
# X shiny::varSelectizeInput
# X shiny::varSelectInput
test_that("required checkbox input", {
x <- shiny::checkboxInput("input_id", "Some checkbox input")
y <- "
\n
\n \n
\n
"
expect_equal(as.character(htmlMarkRequired(x)), y)
})
test_that("required checkbox group input", {
x <- shiny::checkboxGroupInput(
"input_id", "Some checkbox group", choices = c(`Choice 1` = 1, `Choice 2` = 2)
)
y <- "
\n \n
\n
\n \n
\n
\n \n
\n
\n
"
expect_equal(as.character(htmlMarkRequired(x)), y)
})
test_that("required date input", {
x <- shiny::dateInput("input_id", "Some date input")
y <- "
\n \n \n
"
expect_equal(as.character(htmlMarkRequired(x)), y)
})
test_that("required date range input", {
x <- shiny::dateRangeInput("input_id", "Some date range input")
y <- "
\n \n
\n \n \n to \n \n \n
\n
"
expect_equal(as.character(htmlMarkRequired(x)), y)
})
test_that("required file input", {
x <- shiny::fileInput("input_id", "Some file input")
y <- "
\n \n
\n \n \n
\n
\n \n
\n
"
expect_equal(as.character(htmlMarkRequired(x)), y)
})
test_that("required numeric input", {
x <- shiny::numericInput("input_id", "Some numeric input", 0)
y <- "
\n \n \n
"
expect_equal(as.character(htmlMarkRequired(x)), y)
})
test_that("required radio buttons", {
x <- shiny::radioButtons(
"input_id", "Some radio buttons", choices = c(`Choice 1` = 1, `Choice 2` = 2)
)
y <- "
\n \n
\n
\n \n
\n
\n \n
\n
\n
"
expect_equal(as.character(htmlMarkRequired(x)), y)
})
test_that("required text input", {
x <- shiny::textInput("input_id", "Some text input")
y <- "