diff --git a/R/a11y_panel.R b/R/a11y_panel.R index 6be0393..db2198f 100644 --- a/R/a11y_panel.R +++ b/R/a11y_panel.R @@ -107,219 +107,216 @@ a11y_panel <- function( stop("Error: If publication_slug is provided, then so should publication_name.") } shiny::tags$div( - "Accessibility", - shiny::tags$div( - shiny::tags$h1(paste0("Accessibility statement for ", dashboard_title)), - shiny::tags$p( - "This accessibility statement applies to the", - dashboard_url, - "website. This website is run by the ", - external_link( - href = "https://www.gov.uk/government/organisations/department-for-education", - "Department for Education (DfE)" - ), - ".", - "This statement does not cover any other services run by the Department for Education ", - "(DfE) or GOV.UK." + shiny::tags$h1(paste0("Accessibility statement for ", dashboard_title)), + shiny::tags$p( + "This accessibility statement applies to the", + dashboard_url, + "website. This website is run by the ", + external_link( + href = "https://www.gov.uk/government/organisations/department-for-education", + "Department for Education (DfE)" ), - shiny::tags$h2("How you should be able to use this website"), - shiny::tags$p( - "We want as many people as possible to be able to use this website. You should be able to:" + ".", + "This statement does not cover any other services run by the Department for Education ", + "(DfE) or GOV.UK." + ), + shiny::tags$h2("How you should be able to use this website"), + shiny::tags$p( + "We want as many people as possible to be able to use this website. You should be able to:" + ), + shiny::tags$div(tags$ul( + shiny::tags$li( + "change colours, contrast levels and fonts using browser or device settings" ), - shiny::tags$div(tags$ul( - shiny::tags$li( - "change colours, contrast levels and fonts using browser or device settings" - ), - shiny::tags$li( - "zoom in up to 400% without the text spilling off the screen" - ), - shiny::tags$li( - "navigate most of the website using a keyboard or speech recognition software" - ), - shiny::tags$li( - "listen to most of the website using a screen reader - (including the most recent versions of JAWS, NVDA and VoiceOver)" - ) - )), - shiny::tags$p("We've also made the website text as simple as possible to understand."), - shiny::tags$p( - external_link(href = "https://mcmw.abilitynet.org.uk/", "AbilityNet"), - " has advice on making your device easier to use if you have a disability." + shiny::tags$li( + "zoom in up to 400% without the text spilling off the screen" ), - shiny::tags$h2("How accessible this website is"), - if (all(is.null(non_accessible_components))) { - shiny::tags$p("This website is fully compliant with accessibility standards.") - } else { - shiny::tagList( - shiny::tags$p("We know some parts of this website are not fully accessible:"), - shiny::tags$div(tags$ol( - tagList(lapply(non_accessible_components, shiny::tags$li)) - )) - ) - }, - shiny::tags$h2("Feedback and contact information"), - if (!is.null(publication_slug)) { - shiny::tagList( - shiny::tags$p( - "If you need information on this website in a different format please see the", - " parent publication, ", - external_link( - href = paste0( - "https://explore-education-statistics.service.gov.uk/find-statistics/", - publication_slug - ), - link_text = publication_name + shiny::tags$li( + "navigate most of the website using a keyboard or speech recognition software" + ), + shiny::tags$li( + "listen to most of the website using a screen reader + (including the most recent versions of JAWS, NVDA and VoiceOver)" + ) + )), + shiny::tags$p("We've also made the website text as simple as possible to understand."), + shiny::tags$p( + external_link(href = "https://mcmw.abilitynet.org.uk/", "AbilityNet"), + " has advice on making your device easier to use if you have a disability." + ), + shiny::tags$h2("How accessible this website is"), + if (all(is.null(non_accessible_components))) { + shiny::tags$p("This website is fully compliant with accessibility standards.") + } else { + shiny::tagList( + shiny::tags$p("We know some parts of this website are not fully accessible:"), + shiny::tags$div(tags$ol( + tagList(lapply(non_accessible_components, shiny::tags$li)) + )) + ) + }, + shiny::tags$h2("Feedback and contact information"), + if (!is.null(publication_slug)) { + shiny::tagList( + shiny::tags$p( + "If you need information on this website in a different format please see the", + " parent publication, ", + external_link( + href = paste0( + "https://explore-education-statistics.service.gov.uk/find-statistics/", + publication_slug ), - "." + link_text = publication_name ), - shiny::tags$p( - "More details are available on that service for alternative formats of this ", - "data." - ) + "." + ), + shiny::tags$p( + "More details are available on that service for alternative formats of this ", + "data." ) - }, - shiny::tags$p("We're always looking to improve the accessibility of this website. + ) + }, + shiny::tags$p("We're always looking to improve the accessibility of this website. If you find any problems not listed on this page or think we're not meeting accessibility requirements, contact us:"), - shiny::tags$ul(tags$li( - shiny::tags$a( - href = "mailto:explore.statistics@education.gov.uk", - "explore.statistics@education.gov.uk" - ) - )), - shiny::tags$h2("Enforcement procedure"), - shiny::tags$p( - "The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public ", - "Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018", - "(the \"accessibility regulations\")." + shiny::tags$ul(tags$li( + shiny::tags$a( + href = "mailto:explore.statistics@education.gov.uk", + "explore.statistics@education.gov.uk" + ) + )), + shiny::tags$h2("Enforcement procedure"), + shiny::tags$p( + "The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public ", + "Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018", + "(the \"accessibility regulations\")." + ), + shiny::tags$p( + "If you are not happy with how we respond to your complaint, contact the ", + external_link( + href = "https://www.equalityadvisoryservice.com/", + "Equality Advisory and Support Service (EASS)" ), + "." + ), + shiny::tags$h2("Technical information about this website's accessibility"), + shiny::tags$p( + "The Department for Education (DfE) is committed to making its website accessible, in ", + "accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) ", + "Accessibility Regulations 2018." + ), + shiny::tags$h3("Compliance status"), + if (all(is.null(specific_issues))) { shiny::tags$p( - "If you are not happy with how we respond to your complaint, contact the ", + "This website is fully compliant with the ", external_link( - href = "https://www.equalityadvisoryservice.com/", - "Equality Advisory and Support Service (EASS)" + href = "https://www.w3.org/TR/WCAG22/", + "Web Content Accessibility Guidelines version 2.2 AA standard" ), "." - ), - shiny::tags$h2("Technical information about this website's accessibility"), - shiny::tags$p( - "The Department for Education (DfE) is committed to making its website accessible, in ", - "accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) ", - "Accessibility Regulations 2018." - ), - shiny::tags$h3("Compliance status"), - if (all(is.null(specific_issues))) { + ) + } else { + shiny::tagList( shiny::tags$p( - "This website is fully compliant with the ", + "This website is partially compliant with the ", external_link( href = "https://www.w3.org/TR/WCAG22/", "Web Content Accessibility Guidelines version 2.2 AA standard" ), - "." - ) - } else { - shiny::tagList( - shiny::tags$p( - "This website is partially compliant with the ", - external_link( - href = "https://www.w3.org/TR/WCAG22/", - "Web Content Accessibility Guidelines version 2.2 AA standard" - ), - " due to the non-compliances listed below." - ), - shiny::tags$h3("Non accessible content"), - shiny::tags$p("The content listed below is non-accessible for the following reasons. - We will address these issues to ensure our content is accessible."), - shiny::tags$div(tags$ol( - tagList(lapply(specific_issues, shiny::tags$li)) - )) - ) - }, - shiny::tags$h3("Disproportionate burden"), - shiny::tags$p("Not applicable."), - shiny::tags$h2("How we tested this website"), - shiny::tags$p( - "The template used for this website was last tested on", - date_template_reviewed, - " against ", - external_link( - href = "https://www.w3.org/TR/WCAG22/", - "Accessibility Guidelines WCAG2.2" - ), - ". The test was carried out by the ", - external_link( - href = "https://digitalaccessibilitycentre.org/", - "Digital accessibility centre (DAC)" + " due to the non-compliances listed below." ), - "." + shiny::tags$h3("Non accessible content"), + shiny::tags$p("The content listed below is non-accessible for the following reasons. + We will address these issues to ensure our content is accessible."), + shiny::tags$div(tags$ol( + tagList(lapply(specific_issues, shiny::tags$li)) + )) + ) + }, + shiny::tags$h3("Disproportionate burden"), + shiny::tags$p("Not applicable."), + shiny::tags$h2("How we tested this website"), + shiny::tags$p( + "The template used for this website was last tested on", + date_template_reviewed, + " against ", + external_link( + href = "https://www.w3.org/TR/WCAG22/", + "Accessibility Guidelines WCAG2.2" ), - shiny::tags$p( - "DAC tested a sample of pages to cover the core functionality of the service including:" + ". The test was carried out by the ", + external_link( + href = "https://digitalaccessibilitycentre.org/", + "Digital accessibility centre (DAC)" ), - shiny::tags$div(tags$ul( - shiny::tags$li("navigation"), - shiny::tags$li("interactive dropdown selections"), - shiny::tags$li("charts, maps, and tables") - )), - shiny::tags$p( - "This specific website was was last tested on ", date_tested, " against ", - external_link( - href = "https://www.w3.org/TR/WCAG22/", - "Accessibility Guidelines WCAG2.2" - ), - ". The test was carried out by the ", - external_link( - href = "https://www.gov.uk/government/organisations/department-for-education", - "Department for Education (DfE)" - ), - "." + "." + ), + shiny::tags$p( + "DAC tested a sample of pages to cover the core functionality of the service including:" + ), + shiny::tags$div(tags$ul( + shiny::tags$li("navigation"), + shiny::tags$li("interactive dropdown selections"), + shiny::tags$li("charts, maps, and tables") + )), + shiny::tags$p( + "This specific website was was last tested on ", date_tested, " against ", + external_link( + href = "https://www.w3.org/TR/WCAG22/", + "Accessibility Guidelines WCAG2.2" ), - shiny::tags$h2("What we're doing to improve accessibility"), - shiny::tags$p( - "We plan to continually test the service for accessibility issues, and are working ", - "through a prioritised list of issues to resolve." + ". The test was carried out by the ", + external_link( + href = "https://www.gov.uk/government/organisations/department-for-education", + "Department for Education (DfE)" ), - shiny::tags$p( - if (!is.null(issues_contact)) { - if (is_valid_repo_url(issues_contact)) { - shiny::tagList( - "Our current list of issues to be resolved is available on our ", - external_link( - href = paste0(issues_contact, "/issues"), - "GitHub issues page" - ), - "." - ) - } else { - shiny::tagList( - "To discuss our current list of issues to be resolved contact us at", - shiny::tags$a( - href = paste0("mailto:", issues_contact), - issues_contact - ), - "." - ) - } + "." + ), + shiny::tags$h2("What we're doing to improve accessibility"), + shiny::tags$p( + "We plan to continually test the service for accessibility issues, and are working ", + "through a prioritised list of issues to resolve." + ), + shiny::tags$p( + if (!is.null(issues_contact)) { + if (is_valid_repo_url(issues_contact)) { + shiny::tagList( + "Our current list of issues to be resolved is available on our ", + external_link( + href = paste0(issues_contact, "/issues"), + "GitHub issues page" + ), + "." + ) } else { - " " - }, + shiny::tagList( + "To discuss our current list of issues to be resolved contact us at", + shiny::tags$a( + href = paste0("mailto:", issues_contact), + issues_contact + ), + "." + ) + } + } else { + " " + }, + ), + shiny::tags$h2("Preparation of this accessibility statement"), + shiny::tags$p( + paste0( + "This statement was prepared on ", + date_prepared, + " and last reviewed on ", + date_reviewed, + "." ), - shiny::tags$h2("Preparation of this accessibility statement"), - shiny::tags$p( - paste0( - "This statement was prepared on ", - date_prepared, - " and last reviewed on ", - date_reviewed, - "." - ), - "The statement was produced based on a combination of testing carried out by the ", - external_link( - href = "https://digitalaccessibilitycentre.org/", - "Digital accessibility centre (DAC)" - ), - " and our own testing." - ) + "The statement was produced based on a combination of testing carried out by the ", + external_link( + href = "https://digitalaccessibilitycentre.org/", + "Digital accessibility centre (DAC)" + ), + " and our own testing." ) ) } diff --git a/tests/testthat/test-a11y_panel.R b/tests/testthat/test-a11y_panel.R index f074a78..43e08bb 100644 --- a/tests/testthat/test-a11y_panel.R +++ b/tests/testthat/test-a11y_panel.R @@ -192,34 +192,33 @@ output <- a11y_panel( test_that("HTML headings output from function", { # This checks the headings are in the expected positions in the HTML output the function returns - expect_equal(paste(output$children[[1]]), "Accessibility") expect_equal( - paste(output$children[[2]]$children[[1]]), + paste(output$children[[1]]), "

Accessibility statement for DfE Shiny template

" ) expect_equal( - paste(output$children[[2]]$children[[3]]), + paste(output$children[[3]]), "

How you should be able to use this website

" ) - expect_equal(paste(output$children[[2]]$children[[8]]), "

How accessible this website is

") + expect_equal(paste(output$children[[8]]), "

How accessible this website is

") expect_equal( - paste(output$children[[2]]$children[[10]]), + paste(output$children[[10]]), "

Feedback and contact information

" ) - expect_equal(paste(output$children[[2]]$children[[14]]), "

Enforcement procedure

") + expect_equal(paste(output$children[[14]]), "

Enforcement procedure

") expect_equal( - paste(output$children[[2]]$children[[17]]), + paste(output$children[[17]]), "

Technical information about this website's accessibility

" ) - expect_equal(paste(output$children[[2]]$children[[19]]), "

Compliance status

") - expect_equal(paste(output$children[[2]]$children[[21]]), "

Disproportionate burden

") - expect_equal(paste(output$children[[2]]$children[[23]]), "

How we tested this website

") + expect_equal(paste(output$children[[19]]), "

Compliance status

") + expect_equal(paste(output$children[[21]]), "

Disproportionate burden

") + expect_equal(paste(output$children[[23]]), "

How we tested this website

") expect_equal( - paste(output$children[[2]]$children[[28]]), + paste(output$children[[28]]), "

What we're doing to improve accessibility

" ) expect_equal( - paste(output$children[[2]]$children[[31]]), + paste(output$children[[31]]), "

Preparation of this accessibility statement

" ) }) @@ -230,13 +229,13 @@ test_that( expect_true( grepl( "https://department-for-education.shinyapps.io/dfe-shiny-template", - paste0(output$children[[2]]$children[[2]]) + paste0(output$children[[2]]) ) ) expect_true( grepl( "https://github.com/dfe-analytical-services/shiny-template/issues", - paste0(output$children[[2]]$children[[30]]) + paste0(output$children[[30]]) ) ) }