Skip to content

Commit

Permalink
Merge branch 'main' into 17-Deployment-yaml-template
Browse files Browse the repository at this point in the history
  • Loading branch information
oadetayo authored Jan 2, 2025
2 parents 79bc92c + 10839ea commit 30180e5
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 61 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dfeshiny
Title: DfE R Shiny Standards
Version: 0.5.3
Version: 0.5.3.9000
Authors@R: c(
person("Rich", "Bielby", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-9070-9969")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# dfeshiny (development version)

* Added extra flexibility to custom disconnect message in contact details and refresh link
* Relaxed arguments in cookies banner so different IDs can be used for navigation panel
* Fixed bug with inputId in the cookies banner

# dfeshiny 0.5.3

* Added `dfeshiny::a11y_panel()` to create model accessibility statement with custom
Expand Down
2 changes: 1 addition & 1 deletion R/cookies.R
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ cookies_banner_server <- function(
# updateTabsetPanel to have a cookie page for instance
shiny::updateTabsetPanel(
session = parent_session,
inputID = cookies_nav_id,
inputId = cookies_nav_id,
selected = cookies_link_panel
)
})
Expand Down
45 changes: 23 additions & 22 deletions dfeshiny.Rproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
LineEndingConversion: Posix

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
Version: 1.0
ProjectId: 542ddaed-ab53-4f0c-8930-7994a4453a0d

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
LineEndingConversion: Posix

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"input": {
"cookies": {
"dfe_analytics": "granted"

},
"cookies_banner-cookies_accept": 1,
"cookies_banner-cookies_link": 0,
"cookies_banner-cookies_accept": 0,
"cookies_banner-cookies_link": 1,
"cookies_banner-cookies_reject": 0,
"cookies_panel-cookies_analytics": "yes",
"cookies_panel-cookies_analytics": "no",
"cookies_panel-submit_btn": 0,
"navlistPanel": "support_panel"
"navlistPanel": "cookies_panel_ui"
},
"output": {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"input": {
"cookies": {
"dfe_analytics": "denied"
"dfe_analytics": "granted"
},
"cookies_banner-cookies_accept": 1,
"cookies_banner-cookies_link": 0,
"cookies_banner-cookies_reject": 1,
"cookies_panel-cookies_analytics": "no",
"cookies_banner-cookies_link": 1,
"cookies_banner-cookies_reject": 0,
"cookies_panel-cookies_analytics": "yes",
"cookies_panel-submit_btn": 0,
"navlistPanel": "support_panel"
"navlistPanel": "cookies_panel_ui"
},
"output": {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"input": {
"cookies": {
"dfe_analytics": "granted"
"dfe_analytics": "denied"
},
"cookies_banner-cookies_accept": 1,
"cookies_banner-cookies_link": 0,
"cookies_banner-cookies_link": 1,
"cookies_banner-cookies_reject": 1,
"cookies_panel-cookies_analytics": "yes",
"cookies_panel-submit_btn": 1,
"navlistPanel": "support_panel"
"cookies_panel-cookies_analytics": "no",
"cookies_panel-submit_btn": 0,
"navlistPanel": "cookies_panel_ui"
},
"output": {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"input": {
"cookies": {
"dfe_analytics": "denied"
"dfe_analytics": "granted"
},
"cookies_banner-cookies_accept": 1,
"cookies_banner-cookies_link": 0,
"cookies_banner-cookies_link": 1,
"cookies_banner-cookies_reject": 1,
"cookies_panel-cookies_analytics": "no",
"cookies_panel-submit_btn": 2,
"navlistPanel": "support_panel"
"cookies_panel-cookies_analytics": "yes",
"cookies_panel-submit_btn": 1,
"navlistPanel": "cookies_panel_ui"
},
"output": {

Expand Down
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": {

}
}
35 changes: 18 additions & 17 deletions tests/test_dashboard/tests/testthat/test-UI-02-cookies.R
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()
})

0 comments on commit 30180e5

Please sign in to comment.