Skip to content

Test virtualSelectInput updateOn = "close" #743

@jonthegeek

Description

@jonthegeek

I added some simple tests for virtualSelectInput() in #742, but I couldn't get onclose tests to work immediately, and I wanted to get a test in place before I find time to dig in more deeply. We almost certainly need to set the input "physically" (by interacting with the module via javascript rather than by setting inputs directly), and that will take a little more digging to put into place. This is the failing (in that it doesn't see the change, not that it actually fails) version of that test:

test_that("virtualSelectInput updates reactives onclose", {
  skip_on_cran()
  skip_if_not_installed("shinytest2")
  app <- AppDriver$new(
    test_path("apps", "virtualSelectInput"),
    name = "virtualSelectInput-onclose",
    width = 800,
    height = 600
  )
  app$wait_for_value(input = "single", timeout = 2000)
  app$set_inputs(onclose_open = FALSE)
  app$set_inputs(onclose_open = TRUE)
  app$set_inputs(onclose = c("Jan", "Feb"))
  app$set_inputs(onclose_open = FALSE)
  app$expect_values(input = "onclose", name = "onclose")
  app$stop()
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions