@@ -18,29 +18,26 @@ test_that("test dropdown_input", {
1818si_str ,fixed = TRUE )))
1919})
2020
21- init_driver <- function (app ) {
22- shinytest2 :: AppDriver $ new(app )
23- }
24-
25- test_app <- function (value ,initial_value ,multiple ,choices = NULL ,initial_choices = LETTERS ) {
26- type <- if (multiple )" multiple" else " "
27- shiny :: shinyApp(
28- ui = semanticPage(
29- dropdown_input(" dropdown" ,initial_choices ,value = initial_value ,type = type ),
30- shiny :: actionButton(" trigger" ," Trigger" )
31- ),
32- server = function (input ,output ,session ) {
33- shiny :: observeEvent(input $ trigger , {
34- update_dropdown_input(session ," dropdown" ,value = value ,choices = choices )
35- })
36- }
37- )
38- }
3921
4022describe(" update_dropdown_input" , {
4123 skip_on_cran()
4224 local_edition(3 )
4325
26+ test_app <- function (value ,initial_value ,multiple ,choices = NULL ,initial_choices = LETTERS ) {
27+ type <- if (multiple )" multiple" else " "
28+ shiny :: shinyApp(
29+ ui = semanticPage(
30+ dropdown_input(" dropdown" ,initial_choices ,value = initial_value ,type = type ),
31+ shiny :: actionButton(" trigger" ," Trigger" )
32+ ),
33+ server = function (input ,output ,session ) {
34+ shiny :: observeEvent(input $ trigger , {
35+ update_dropdown_input(session ," dropdown" ,value = value ,choices = choices )
36+ })
37+ }
38+ )
39+ }
40+
4441 it(" is a no-op with NULL value" , {
4542# Arrange
4643initial_value <- " A"