Skip to content

Commit

Permalink
Testing/vote 2963 testing (#1137)
Browse files Browse the repository at this point in the history
* Vote-3106: Bug fixes for RTL styles (#1099)

* VOTE-3081 Remove underline, text-align from allowed tags (#1112)

* VOTE-3108 resolve regression in nvrf template (#1121)

Co-authored-by: tt-gsa <139235281+tt-gsa@users.noreply.github.com>

* VOTE-3059 add new field to nvrf report listing and export (#1122)

* Vote-3155: Updating link validation tests (#1127)

* Vote-3142: Remove when:always flag (#1134)

* VOTE-2963: update conditions for running downsync workflows

---------

Co-authored-by: Christian Medders - Bixal <88721460+clmedders@users.noreply.github.com>
Co-authored-by: SamiraMSadat <108487505+SamiraMSadat@users.noreply.github.com>
Co-authored-by: Ray Estrada <raymond.estrada@gsa.gov>
  • Loading branch information
4 people authored Nov 27, 2024
1 parent 91c09cd commit beaad4e
Show file tree
Hide file tree
Showing 13 changed files with 323 additions and 23 deletions.
10 changes: 6 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,20 @@ link-validation-workflow:
downsync-backup:
when:
and:
- equal: [api, << pipeline.trigger_source >> ]
- or:
- equal: [ prod, << pipeline.parameters.backup >> ]
- equal: [ prod, << pipeline.parameters.backup >> ]
- equal: [ prod, << pipeline.git.branch >> ]
jobs:
- downsync-backup
downsync-restore:
when:
and:
- equal: [api, << pipeline.trigger_source >> ]
- or:
- equal: [ dev, << pipeline.parameters.restore >> ]
- equal: [ stage, << pipeline.parameters.restore >> ]
- equal: [ test, << pipeline.parameters.restore >> ]
- not:
- or:
- equal: [ prod, << pipeline.parameters.restore >> ]
- equal: [ prod, << pipeline.git.branch >> ]
jobs:
- downsync-restore
2 changes: 0 additions & 2 deletions config/sync/editor.editor.basic_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ settings:
items:
- bold
- italic
- underline
- heading
- style
- removeFormat
Expand All @@ -22,7 +21,6 @@ settings:
- numberedList
- indent
- outdent
- alignment
- '|'
- horizontalLine
- link
Expand Down
2 changes: 1 addition & 1 deletion config/sync/filter.format.basic_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ filters:
status: true
weight: -10
settings:
allowed_html: '<br> <p class="usa-intro text-align-left text-align-center text-align-right"> <h2 id class> <h3 class> <h4 class="text-align-left text-align-center text-align-right"> <h5 class="text-align-left text-align-center text-align-right"> <h6 class="text-align-left text-align-center text-align-right"> <a class href aria-label title target="_blank" rel> <div id class data-allow-multiple> <button type class aria-expanded aria-controls> <img src alt height width> <strong> <em> <u> <ul class> <ol> <li class> <hr> <drupal-media data-entity-type data-entity-uuid alt> <embedded-content data-plugin-config data-plugin-id>'
allowed_html: '<br> <p class="usa-intro"> <h2 id class> <h3 class> <h4> <h5> <h6> <a class href aria-label title target="_blank" rel> <div id class data-allow-multiple> <button type class aria-expanded aria-controls> <img src alt height width> <strong> <em> <ul class> <ol> <li class> <hr> <drupal-media data-entity-type data-entity-uuid alt> <embedded-content data-plugin-config data-plugin-id>'
filter_html_help: true
filter_html_nofollow: false
media_embed:
Expand Down
209 changes: 209 additions & 0 deletions config/sync/views.view.nvrf_state_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ dependencies:
- field.storage.node.field_accepts_nvrf
- field.storage.node.field_address_location_inst
- field.storage.node.field_identification_inst
- field.storage.node.field_mail_registration_link
- field.storage.node.field_mailing_address_inst
- field.storage.node.field_nvrf_fields
- field.storage.node.field_nvrf_last_updated_date
- field.storage.node.field_override_mail_reg_link
- field.storage.node.field_personal_information_inst
- field.storage.node.field_political_party_inst
- field.storage.node.field_reg_eligibility_desc
Expand All @@ -18,6 +20,7 @@ dependencies:
module:
- csv_serialization
- datetime
- link
- node
- options
- rest
Expand Down Expand Up @@ -608,6 +611,140 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
field_mail_registration_link:
id: field_mail_registration_link
table: node__field_mail_registration_link
field: field_mail_registration_link
relationship: none
group_type: group
admin_label: ''
plugin_id: field
label: 'State mail-in PDF link'
exclude: true
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: uri
type: link
settings:
trim_length: null
url_only: true
url_plain: true
rel: '0'
target: '0'
group_column: ''
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
field_override_mail_reg_link:
id: field_override_mail_reg_link
table: node__field_override_mail_reg_link
field: field_override_mail_reg_link
relationship: none
group_type: group
admin_label: ''
plugin_id: field
label: 'State mail-in PDF link'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: '{{ field_mail_registration_link }}'
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: uri
type: link
settings:
trim_length: null
url_only: true
url_plain: true
rel: '0'
target: '0'
group_column: ''
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
edit_node:
id: edit_node
table: node_field_revision
Expand Down Expand Up @@ -815,8 +952,10 @@ display:
- 'config:field.storage.node.field_accepts_nvrf'
- 'config:field.storage.node.field_address_location_inst'
- 'config:field.storage.node.field_identification_inst'
- 'config:field.storage.node.field_mail_registration_link'
- 'config:field.storage.node.field_mailing_address_inst'
- 'config:field.storage.node.field_nvrf_last_updated_date'
- 'config:field.storage.node.field_override_mail_reg_link'
- 'config:field.storage.node.field_personal_information_inst'
- 'config:field.storage.node.field_political_party_inst'
- 'config:field.storage.node.field_reg_eligibility_desc'
Expand Down Expand Up @@ -1393,6 +1532,73 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
field_mail_registration_link:
id: field_mail_registration_link
table: node__field_mail_registration_link
field: field_mail_registration_link
relationship: none
group_type: group
admin_label: ''
plugin_id: field
label: 'State mail-in PDF link'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: uri
type: link
settings:
trim_length: null
url_only: true
url_plain: true
rel: '0'
target: '0'
group_column: ''
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
style:
type: data_export
options:
Expand Down Expand Up @@ -1430,6 +1636,7 @@ display:
- 'config:field.storage.node.field_accepts_nvrf'
- 'config:field.storage.node.field_address_location_inst'
- 'config:field.storage.node.field_identification_inst'
- 'config:field.storage.node.field_mail_registration_link'
- 'config:field.storage.node.field_mailing_address_inst'
- 'config:field.storage.node.field_nvrf_last_updated_date'
- 'config:field.storage.node.field_personal_information_inst'
Expand Down Expand Up @@ -1711,8 +1918,10 @@ display:
- 'config:field.storage.node.field_accepts_nvrf'
- 'config:field.storage.node.field_address_location_inst'
- 'config:field.storage.node.field_identification_inst'
- 'config:field.storage.node.field_mail_registration_link'
- 'config:field.storage.node.field_mailing_address_inst'
- 'config:field.storage.node.field_nvrf_last_updated_date'
- 'config:field.storage.node.field_override_mail_reg_link'
- 'config:field.storage.node.field_personal_information_inst'
- 'config:field.storage.node.field_political_party_inst'
- 'config:field.storage.node.field_reg_eligibility_desc'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/// <reference types="Cypress" />

const allPages = require("../../fixtures/site-pages.json");
// ! IMPORTANT: When testing locally, comment out the LIVE_URL and use the LOCAL_URL listed below for testing purposes. This is necessary because our pipeline testing targets the live site. Remember to revert this change before committing, ensuring the LIVE_URL is set as the base.
// const baseUrl = "http://vote-gov.lndo.site/";

const baseUrl = "https://vote.gov";
const excludedLinks = [
Expand Down
16 changes: 13 additions & 3 deletions testing/cypress/e2e/internalLinks/internal-links-validator.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
/// <reference types="Cypress" />

const allPages = require("../../fixtures/site-pages.json");
// ! IMPORTANT: When testing locally, comment out the LIVE_URL and use the LOCAL_URL listed below for testing purposes. This is necessary because our pipeline testing targets the live site. Remember to revert this change before committing, ensuring the LIVE_URL is set as the base.
// const baseUrl = "http://vote-gov.lndo.site/";

const baseUrl = "https://vote.gov";
const excludedLinks = [
'http://vote-gov.lndo.site/',
'https://vote.gov'
];

describe("Internal Link Validator Test", () => {
const singlePage =
Expand All @@ -25,17 +33,19 @@ describe("Internal Link Validator Test", () => {
}
: {},
() => {
cy.visit({
url: page.route,
});
cy.visit(`${baseUrl}${page.route}`);
cy.get("a[href^='/']").each(link => {
const href = link.prop("href");
if (excludedLinks.indexOf(href) === -1) {
expect(href).not.match(/\/$/);
cy.request({
url: link.prop('href'),
failOnStatusCode: false,
timeout: 180000 // 3 minutes
}).then((response) => {
expect(response.status).to.eq(200)
})
}
})
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
@forward "usa-in-page-nav";
@forward "usa-identifier";
@forward "usa-step-indicator";
@forward "usa-link-external";

29 changes: 29 additions & 0 deletions web/themes/custom/votegov/src/sass/uswds-overrides/usa-alert.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@use "uswds-core" as *;
@use "variables" as *;
@use "mixins" as *;

// targeting inline alerts and individually setting the border color
.usa-alert {
border-left: none;

&.usa-alert--warning {
border-inline-start: 0.5rem color('gold-20v') solid;
}

&.usa-alert--info {
border-inline-start: 0.5rem color('accent-cool') solid;
}
}

.usa-alert--info,
.usa-alert__body > * {
margin-left: unset;
margin-inline-start: 2.5rem;
}

.usa-alert .usa-alert__body {
&:before {
left: unset;
inset-inline-start: 1rem;
}
}
Loading

0 comments on commit beaad4e

Please sign in to comment.