-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add UI test for cookies information link (#78)
* add UI test for cookies information link * update test snapshots * stop lintr flagging commented out code issue * sometimes lintr really does do your nut in
- Loading branch information
Showing
6 changed files
with
57 additions
and
37 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
tests/test_dashboard/tests/testthat/_snaps/UI-02-cookies/cookies_consent-001.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
tests/test_dashboard/tests/testthat/_snaps/UI-02-cookies/cookies_consent-002.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
tests/test_dashboard/tests/testthat/_snaps/UI-02-cookies/cookies_consent-003.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
tests/test_dashboard/tests/testthat/_snaps/UI-02-cookies/cookies_consent-004.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/test_dashboard/tests/testthat/_snaps/UI-02-cookies/cookies_consent-005.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"input": { | ||
"cookies": { | ||
"dfe_analytics": "denied" | ||
}, | ||
"cookies_banner-cookies_accept": 1, | ||
"cookies_banner-cookies_link": 1, | ||
"cookies_banner-cookies_reject": 1, | ||
"cookies_panel-cookies_analytics": "no", | ||
"cookies_panel-submit_btn": 2, | ||
"navlistPanel": "cookies_panel_ui" | ||
}, | ||
"output": { | ||
|
||
}, | ||
"export": { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
# To run the diffviewer on these tests, you need to add the path: | ||
# Doesn't work? testthat::snapshot_review('UI-02-cookies/', path='tests/test_dashboard/') | ||
# like this! testthat::snapshot_review('UI-02-cookies/', path='tests/test_dashboard/tests/testthat') | ||
app <- AppDriver$new( | ||
name = "cookies_consent", | ||
expect_values_screenshot_args = FALSE | ||
) | ||
|
||
app$wait_for_idle(50) | ||
|
||
app$click("cookies_banner-cookies_accept") | ||
app$wait_for_idle(50) | ||
test_that("Can click view cookie information", { | ||
app$click("cookies_banner-cookies_link") | ||
app$wait_for_idle(50) | ||
app$expect_values() | ||
}) | ||
|
||
test_that("Cookies accepted banner", { | ||
app$click("cookies_banner-cookies_accept") | ||
app$wait_for_idle(50) | ||
app$expect_values() | ||
}) | ||
|
||
app$click("cookies_banner-cookies_reject") | ||
app$wait_for_idle(50) | ||
|
||
test_that("Cookies rejected banner", { | ||
app$click("cookies_banner-cookies_reject") | ||
app$wait_for_idle(50) | ||
app$expect_values() | ||
}) | ||
|
||
app$set_inputs(`cookies_panel-cookies_analytics` = "yes") | ||
app$wait_for_idle(50) | ||
|
||
app$click("cookies_panel-submit_btn") | ||
app$wait_for_idle(50) | ||
|
||
test_that("Cookies accepted page", { | ||
app$set_inputs(`cookies_panel-cookies_analytics` = "yes") | ||
app$wait_for_idle(50) | ||
app$click("cookies_panel-submit_btn") | ||
app$wait_for_idle(50) | ||
app$expect_values() | ||
}) | ||
|
||
app$set_inputs(`cookies_panel-cookies_analytics` = "no") | ||
app$wait_for_idle(50) | ||
|
||
app$click("cookies_panel-submit_btn") | ||
app$wait_for_idle(50) | ||
|
||
test_that("Cookies rejected page", { | ||
app$set_inputs(`cookies_panel-cookies_analytics` = "no") | ||
app$wait_for_idle(50) | ||
app$click("cookies_panel-submit_btn") | ||
app$wait_for_idle(50) | ||
app$expect_values() | ||
}) |