test_that("Radio buttons UI is generated and working correctly", {
testthat::expect_equal(class(radio_buttons_ui), "function")
testthat::expect_s3_class(radio_buttons_ui("test"), "shiny.tag")
})
# See ?testServer for more information
test_that("Radio buttons Server is generated and working correctly", {
shiny::testServer(radio_buttons_server, {
# Set initial value of a button
cat("Initially, radio input is NULL, right?",
is.null(input$radio),
"\n")
session$setInputs(radio = "a")
cat("Just set the value of the radio button to 'a'? ",
input$radio == 'a',
"\n")
expect_equal(input$radio, "a")
})
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.