Skip to content

Commit

Permalink
Switches to expect_values instead of snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
edgararuiz committed Apr 3, 2024
1 parent a5e8213 commit abd2f54
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 46 deletions.
11 changes: 0 additions & 11 deletions tests/testthat/_snaps/app-server/001.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
{
"input": {
"close": 0,
"options": 0,
"prompt": "",
"submit": 0,
"tabs": null
},
"output": {
"provider": "Test",
"stream": ""
},
"export": {

}
}
16 changes: 0 additions & 16 deletions tests/testthat/_snaps/app-server/002.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
{
"input": {
"close": 0,
"i_data": "0",
"i_files": "0",
"i_history": false,
"options": 1,
"prompt": "",
"prompt2": "Use the R language, the tidyverse, and tidymodels",
"saved": 0,
"submit": 1,
"tabs": null
},
"output": {
"provider": "Test",
"stream": ""
},
"export": {

}
}
16 changes: 0 additions & 16 deletions tests/testthat/_snaps/app-server/003.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
{
"input": {
"close": 0,
"i_data": "0",
"i_files": "0",
"i_history": false,
"options": 1,
"prompt": "",
"prompt2": "Use the R language, the tidyverse, and tidymodels",
"saved": 1,
"submit": 1,
"tabs": null
},
"output": {
"provider": "Test",
"stream": ""
},
"export": {

}
}
5 changes: 5 additions & 0 deletions tests/testthat/_snaps/app-server/004.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"output": {

}
}
8 changes: 5 additions & 3 deletions tests/testthat/test-app-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ test_that("chattr app initial values are consistent", {
shiny_app,
options = list("chattr-shiny-test" = TRUE)
)
app$expect_values(screenshot_args = FALSE)
app$expect_values(output = "submit", screenshot_args = FALSE)
app$set_inputs(prompt = "hello", allow_no_input_binding_ = TRUE)
app$click("submit")
app$expect_values(output = "submit", screenshot_args = FALSE)
app$click("options")
app$expect_values(screenshot_args = FALSE)
app$expect_values(output = "options", screenshot_args = FALSE)
app$click("saved")
app$expect_values(screenshot_args = FALSE)
app$expect_values(output = "saved", screenshot_args = FALSE)
app$click("open")
})

test_that("Split content function", {
Expand Down

0 comments on commit abd2f54

Please sign in to comment.