Testing headless interaction

test_that("can set and reset name", {
  
  app <- AppDriver$new(shinyApp(ui, server))
  
  app$set_inputs(name = "Hadley")
  expect_equal(app$get_value(output = "greeting"), "Hi Hadley")
  
  app$click("reset")
  expect_equal(app$get_value(output = "greeting")$message, "")
  
})
#> Test passed 🥇