Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
FatmaBakir committed Nov 13, 2024
2 parents ee77f2f + 9d5009a commit 005f6f9
Show file tree
Hide file tree
Showing 151 changed files with 23,072 additions and 5,756 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-and-deploy-dev-waf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ jobs:
</details>
#### Terraform Apply &#x1f680;`${{ steps.apply.outcome }}`
- name: Update Project Status
env:
GH_PROJECT_NUMBER: ${{ secrets.GH_PROJECT_NUMBER }}
GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
ISSUE_NUMBER: ${{ steps.issue.outputs.number }}
run: source ./scripts/pipeline/github-update-issue-status.sh
# - name: Update Project Status
# env:
# GH_PROJECT_NUMBER: ${{ secrets.GH_PROJECT_NUMBER }}
# GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
# ISSUE_NUMBER: ${{ steps.issue.outputs.number }}
# run: source ./scripts/pipeline/github-update-issue-status.sh
stopBastion:
name: Stop Bastion
runs-on: ubuntu-latest
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build-and-deploy-main-waf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ jobs:
</details>
#### Terraform Apply &#x1f680;`${{ steps.apply.outcome }}`
- name: Update Project Status
env:
GH_PROJECT_NUMBER: ${{ secrets.GH_PROJECT_NUMBER }}
GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
ISSUE_NUMBER: ${{ steps.issue.outputs.number }}
run: |
source ./scripts/pipeline/github-update-issue-status.sh
### Terraform Apply &#x1f680;`${{ steps.apply.outcome }}`
# - name: Update Project Status
# env:
# GH_PROJECT_NUMBER: ${{ secrets.GH_PROJECT_NUMBER }}
# GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
# ISSUE_NUMBER: ${{ steps.issue.outputs.number }}
# run: |
# source ./scripts/pipeline/github-update-issue-status.sh

stopBastion:
name: Stop Bastion
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ jobs:
git submodule update
cd usagov-2021
git checkout prod
- name: Insert rewrite rules in alphabetical order
run: |
sed -i '/^ rewrite \^\/benefits-grants-loans/a\ rewrite ^/benefit-finder/([^/]+)/[^/]+$ /benefit-finder/$1 permanent;' ./usagov-2021/.docker/src-cms/etc/nginx/partials/internal_redirects.conf
sed -i '/^ rewrite \^\/espanol\/beneficios-familias-militares/a\ rewrite ^/espanol/benefit-finder/([^/]+)/[^/]+$ /espanol/benefit-finder/$1 permanent;' ./usagov-2021/.docker/src-cms/etc/nginx/partials/internal_redirects.conf
cat ./usagov-2021/.docker/src-cms/etc/nginx/partials/internal_redirects.conf
sed -i 's/^[[:space:]]*# include partials\/internal_redirects.conf;/ include partials\/internal_redirects.conf;/' ./usagov-2021/.docker/src-cms/etc/nginx/partials/cms.conf.tmpl
cat ./usagov-2021/.docker/src-cms/etc/nginx/partials/cms.conf.tmpl
- name: Merge files into module
run: |
bash ./scripts/pipeline/mv-benefit-finder-app.sh
Expand All @@ -153,6 +160,7 @@ jobs:
sed -i 's/\["s3"\]\[\]?/s3\[\]/g' scripts/tome-run.sh scripts/tome-sync.sh
sed -i "s|/var/www/scripts/tome-run.sh \$URI \$@||" .docker/src-cms/etc/periodic/1min/generate-static-site
sed -i 's/80/8080/g' .docker/src-cms/etc/nginx/partials/cms.conf.tmpl
sed -i '/listen 8080 default_server;/a\ port_in_redirect off;' .docker/src-cms/etc/nginx/partials/cms.conf.tmpl
sed -i "s/\$service\['name'\] === 'database'/stristr(\$service\['name'\], 'mysql')/" web/sites/default/settings.php
sed -i "s/\$settings\['hash_salt'\] = \$service\['credentials'\]\['HASH_SALT'\]/\$settings\['hash_salt'\] = \$service\['credentials'\]\['hash_salt'\]/" web/sites/default/settings.php
sed -i "s/\$service\['name'\] === 'storage'/stristr(\$service\['name'\], 'storage')/" web/sites/default/settings.php
Expand All @@ -169,7 +177,7 @@ jobs:
with:
images: ghcr.io/${{ vars.CR_REPOSITORY }}
tags: |
type=sha,enable=true,priority=100,prefix=,suffix=,format=short
type=sha,enable=true,priority=100,prefix=,suffifx=,format=short
- name: Build and push Docker image
# uses: docker/[email protected]
uses: docker/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
push:
paths:
- benefit-finder/*
pull_request:
paths:
- benefit-finder/*

permissions: read-all

Expand Down
2 changes: 2 additions & 0 deletions benefit-finder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
|-nginx
|-src
|-App
|-Routes
|-shared
|-api
|-components
Expand Down Expand Up @@ -45,6 +46,7 @@
| `src/index.jsx` | Entry file. |
| `index.html` | All scripts and styles injected here |
| `src/App` | Main application routes, global / ancestor of all modules. |
| `src/Routes` | Route components |
| `src/shared/api` | dev utils for interacting with data |
| `src/shared/components` | Components, constants, machines, hooks, styles, utils etc; |
| `src/shared/hooks` | Custom Hooks |
Expand Down
27 changes: 18 additions & 9 deletions benefit-finder/cypress/e2e/storybook/aria-attribute-state.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="cypress" />
/// <reference types="Cypress" />

import * as utils from '../../support/utils.js'
import * as EN_LOCALE_DATA from '../../../src/shared/locales/en/en.json'
Expand All @@ -9,6 +9,9 @@ const dob = utils.getDateByOffset(-(18 * 365.2425 - 1))
const relation =
EN_DOLO_MOCK_DATA.data.lifeEventForm.sectionsEligibilityCriteria[0].section
.fieldsets[1].fieldset.inputs[0].inputCriteria.values[1].value
const relationshipId =
EN_DOLO_MOCK_DATA.data.lifeEventForm.sectionsEligibilityCriteria[0].section
.fieldsets[1].fieldset.inputs[0].inputCriteria.id
const status =
EN_DOLO_MOCK_DATA.data.lifeEventForm.sectionsEligibilityCriteria[0].section
.fieldsets[2].fieldset.inputs[0].inputCriteria.values[1].value
Expand All @@ -21,12 +24,12 @@ describe('Validate state of aria-invalid attribute', () => {

it('Should have default state of "false" for select, input, and radio', () => {
pageObjects
.selectField()
.fieldsetById(relationshipId)
.invoke('attr', 'aria-invalid')
.should('eq', 'false')

pageObjects
.inputField()
.benefitMemorableDateById('day')
.invoke('attr', 'aria-invalid')
.should('eq', 'false')

Expand All @@ -40,31 +43,37 @@ describe('Validate state of aria-invalid attribute', () => {
pageObjects.button().contains(EN_LOCALE_DATA.buttonGroup[1].value).click()

pageObjects
.selectField()
.fieldsetById(relationshipId)
.invoke('attr', 'aria-invalid')
.should('eq', 'true')

pageObjects.inputField().invoke('attr', 'aria-invalid').should('eq', 'true')
pageObjects
.benefitMemorableDateById('day')
.invoke('attr', 'aria-invalid')
.should('eq', 'true')
})

it('Should have state of "false" when previous was true but error has been resolved', () => {
pageObjects.button().contains(EN_LOCALE_DATA.buttonGroup[1].value).click()

pageObjects
.selectField()
.fieldsetById(relationshipId)
.invoke('attr', 'aria-invalid')
.should('eq', 'true')
pageObjects
.benefitMemorableDateById('day')
.invoke('attr', 'aria-invalid')
.should('eq', 'true')
pageObjects.inputField().invoke('attr', 'aria-invalid').should('eq', 'true')

utils.dataInputs({ dob, relation, status })

pageObjects
.selectField()
.fieldsetById(relationshipId)
.invoke('attr', 'aria-invalid')
.should('eq', 'false')

pageObjects
.inputField()
.benefitMemorableDateById('day')
.invoke('attr', 'aria-invalid')
.should('eq', 'false')
})
Expand Down
14 changes: 7 additions & 7 deletions benefit-finder/cypress/e2e/storybook/axe-a11y.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ describe(`Validate code passes axe scanning`, () => {
cy.injectAxe() // we inject axe again because of the reload -> visit
// get a node list of all accordions
// get the heading of the first in the list
cy.get(`[data-analytics="bf-usa-accordion"]`).then(accordionItems => {
cy.get(`[data-testid="bf-usa-accordion"]`).then(accordionItems => {
pageObjects
.benefitResultsView()
.invoke('attr', 'data-analytics')
.invoke('attr', 'data-testid')
.should('eq', 'bf-result-view')

pageObjects
.accordion(
`${accordionItems[0].getAttribute('data-analytics-content')}`
.accordionByTitle(
`${accordionItems[0].getAttribute('data-test-accordion-title')}`
)
.click()
runA11y()
Expand All @@ -147,10 +147,10 @@ describe(`Validate code passes axe scanning`, () => {
.click()
// get a node list of all accordions
// get the heading of the first in the list
cy.get(`[data-analytics="bf-usa-accordion"]`).then(accordionItems => {
cy.get(`[data-testid="bf-usa-accordion"]`).then(accordionItems => {
pageObjects
.accordion(
`${accordionItems[0].getAttribute('data-analytics-content')}`
.accordionByTitle(
`${accordionItems[0].getAttribute('data-test-accordion-title')}`
)
.click()
runA11y()
Expand Down
48 changes: 26 additions & 22 deletions benefit-finder/cypress/e2e/storybook/benefitAccordionGroup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,33 @@ describe('BenefitAccordionGroup component tests', () => {
})

it('Validate opening individual accordion expands the clicked accordion and clicking it again closes it', () => {
// we wait for the last event to fire
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2500)
// get the first visible accordion and check if it is expanded
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(0)
.should('have.attr', 'aria-expanded', 'false')
// get the first visible accordion and click it
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button').eq(0).click()
// get the first visible accordion and check if it is expanded
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(0)
.should('have.attr', 'aria-expanded', 'true')
// get the second visible accordion and check if it is expanded
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(1)
.should('have.attr', 'aria-expanded', 'false')
// get the first visible accordion and click it
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button').eq(0).click()
// get the first visible accordion and check if it is expanded
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(0)
.should('have.attr', 'aria-expanded', 'false')
cy.wait(2500).then(() => {
// get the first visible accordion and check if it is expanded
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(0)
.should('have.attr', 'aria-expanded', 'false')
// get the first visible accordion and click it
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(0)
.click()
// get the first visible accordion and check if it is expanded
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(0)
.should('have.attr', 'aria-expanded', 'true')
// get the second visible accordion and check if it is expanded
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(1)
.should('have.attr', 'aria-expanded', 'false')
// get the first visible accordion and click it
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(0)
.click()
// get the first visible accordion and check if it is expanded
cy.get('.bf-usa-accordion:visible .bf-usa-accordion__button')
.eq(0)
.should('have.attr', 'aria-expanded', 'false')
})
})

it('Validate clicking Expand all opens all accordions', () => {
Expand Down
Loading

0 comments on commit 005f6f9

Please sign in to comment.