Debian Codegraph @

inst/app_template/tests/testthat/test-examplemodule.R

raw
1 # See ?testServer for more information
2 testServer(exampleModuleServer, {
3 # Set initial value of a button
4 session$setInputs(button = 0)
5
6 # Check the value of the reactiveVal `count()`
7 expect_equal(count(), 1)
8 # Check the value of the renderText()
9 expect_equal(output$out, "1")
10
11 # Simulate a click
12 session$setInputs(button = 1)
13
14 expect_equal(count(), 2)
15 expect_equal(output$out, "2")
16 })