tests/testthat/test-action.R

test_that("Action UI is generated and working correctly", {
  testthat::expect_equal(class(action_ui), "function")
  testthat::expect_s3_class(action_ui("test"), "shiny.tag")
})

# See ?testServer for more information
# test_that("Action Server is generated and working correctly", {
#   shiny::testServer(action_server,args = list(choices = c("Test Selection","Test Selection 1","Test Selection 2","Test Selection 3")), {
#     # Set initial value of a button
#     cat("Initially, selected input is NULL, right?",
#         is.null(input$select),
#         "\n")
#     session$setInputs(select = "Test Selection")
#     cat("Just set the value of the select to 'Test Selection'? ",
#         input$select == "Test Selection",
#         "\n")
#     expect_equal(input$select, "Test Selection")
#   })
# })
HarryRosen/hrimodules documentation built on Jan. 11, 2022, 12:36 a.m.