From abd2f548ebc478d8e9a1781c56bc5319e08c01c1 Mon Sep 17 00:00:00 2001 From: Edgar Ruiz Date: Wed, 3 Apr 2024 12:13:48 -0500 Subject: [PATCH] Switches to expect_values instead of snapshots --- tests/testthat/_snaps/app-server/001.json | 11 ----------- tests/testthat/_snaps/app-server/002.json | 16 ---------------- tests/testthat/_snaps/app-server/003.json | 16 ---------------- tests/testthat/_snaps/app-server/004.json | 5 +++++ tests/testthat/test-app-server.R | 8 +++++--- 5 files changed, 10 insertions(+), 46 deletions(-) create mode 100644 tests/testthat/_snaps/app-server/004.json diff --git a/tests/testthat/_snaps/app-server/001.json b/tests/testthat/_snaps/app-server/001.json index 473339a..fd2ae4b 100644 --- a/tests/testthat/_snaps/app-server/001.json +++ b/tests/testthat/_snaps/app-server/001.json @@ -1,16 +1,5 @@ { - "input": { - "close": 0, - "options": 0, - "prompt": "", - "submit": 0, - "tabs": null - }, "output": { - "provider": "Test", - "stream": "" - }, - "export": { } } diff --git a/tests/testthat/_snaps/app-server/002.json b/tests/testthat/_snaps/app-server/002.json index dfa676d..fd2ae4b 100644 --- a/tests/testthat/_snaps/app-server/002.json +++ b/tests/testthat/_snaps/app-server/002.json @@ -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": { } } diff --git a/tests/testthat/_snaps/app-server/003.json b/tests/testthat/_snaps/app-server/003.json index 6588cda..fd2ae4b 100644 --- a/tests/testthat/_snaps/app-server/003.json +++ b/tests/testthat/_snaps/app-server/003.json @@ -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": { } } diff --git a/tests/testthat/_snaps/app-server/004.json b/tests/testthat/_snaps/app-server/004.json new file mode 100644 index 0000000..fd2ae4b --- /dev/null +++ b/tests/testthat/_snaps/app-server/004.json @@ -0,0 +1,5 @@ +{ + "output": { + + } +} diff --git a/tests/testthat/test-app-server.R b/tests/testthat/test-app-server.R index f29f831..bea10c8 100644 --- a/tests/testthat/test-app-server.R +++ b/tests/testthat/test-app-server.R @@ -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", {