Skip to content

Commit

Permalink
Merge pull request #1903 from GSA/dev
Browse files Browse the repository at this point in the history
Release v0.8.0.beta.1 (Sprint 43)
  • Loading branch information
XavierMetichecchia authored Oct 30, 2024
2 parents fae6bf3 + 41147b4 commit 2a13c83
Show file tree
Hide file tree
Showing 50 changed files with 393 additions and 415 deletions.
10 changes: 5 additions & 5 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')}`
`${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')}`
`${accordionItems[0].getAttribute('data-test-accordion-title')}`
)
.click()
runA11y()
Expand Down
2 changes: 1 addition & 1 deletion benefit-finder/cypress/e2e/storybook/dataLayer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ describe('Calls to Google Analytics Object', function () {
})
})

it.only('results page with not eligible benefits has a bf_page_change and bf_count events', function () {
it('results page with not eligible benefits has a bf_page_change and bf_count events', function () {
cy.visit(`${utils.storybookUri}${scenario}`)

cy.window().then(window => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,37 +125,37 @@ describe('Validate correct eligibility benefits display based on selected criter

pageObjects
.benefitResultsView()
.invoke('attr', 'data-analytics')
.invoke('attr', 'data-testid')
.should('eq', 'bf-result-view')

pageObjects
.benefitResultsView()
.invoke('attr', 'data-analytics-content')
.invoke('attr', 'data-test-results-view')
.should('eq', 'bf-eligible-view')

pageObjects
.benefitResultsView()
.invoke('attr', 'data-analytics-content-criteria-values')
.invoke('attr', 'data-test-results-view-criteria-values')
.should('eq', `${selectDataLength}`)

pageObjects
.benefitResultsView()
.invoke('attr', 'data-analytics-content-benefits')
.invoke('attr', 'data-test-results-view-benefits')
.should('eq', `${benefitsCount}`)

pageObjects
.benefitResultsView()
.invoke('attr', 'data-analytics-content-eligible')
.invoke('attr', 'data-test-results-view-eligible')
.should('eq', `${enResults.eligible.length}`)

pageObjects
.benefitResultsView()
.invoke('attr', 'data-analytics-content-more-info')
.invoke('attr', 'data-test-results-view-more-info')
.should('eq', `${enResults.moreInformationNeeded.length}`)

pageObjects
.benefitResultsView()
.invoke('attr', 'data-analytics-content-not-eligible')
.invoke('attr', 'data-test-results-view-not-eligible')
.should(
'eq',
`${benefitsCount - enResults.eligible.length - enResults.moreInformationNeeded.length}`
Expand Down
4 changes: 2 additions & 2 deletions benefit-finder/cypress/support/pageObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PageObjects {
}

accordion(heading) {
return cy.get(`[data-analytics-content="${heading}"]`)
return cy.get(`[data-test-accordion-title="${heading}"]`)
}

benefitsAccordion() {
Expand All @@ -87,7 +87,7 @@ class PageObjects {

benefitsAccordionLink(accordionHeading) {
return cy.get(
`[data-analytics-content="${accordionHeading}"] a[data-testid="bf-benefit-link"]`
`[data-test-accordion-title="${accordionHeading}"] a[data-testid="bf-benefit-link"]`
)
}

Expand Down
31 changes: 3 additions & 28 deletions benefit-finder/src/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,7 @@ function App({ testAppContent, testQuery }) {
}
}, [windowQuery, hasQueryParams, stepDataArray])

/**
* Memoized base paths.
*
* @type {Object} An object containing base routes.
*
* @description This value is memoized to prevent unnecessary recalculations.
*/
const BASE_ROUTES = useMemo(() => {
const ROUTES = useMemo(() => {
/**
* Retrieve routes from the application API based on the current window, language, and step data array.
*
Expand All @@ -108,28 +101,10 @@ function App({ testAppContent, testQuery }) {
* @returns {Object} An object containing routes.
*/
return apiCalls.GET.Routes(window, language, stepDataArray)
}, [])

/**
* Retrieve routes for the form steps based on content.
*
* @type {Object} An object containing routes for the form steps.
*/
const FORM_ROUTES = apiCalls.GET.Routes(window, language, stepDataArray)

/**
* A composite object containing both base routes and form paths.
*
* @type {Object} An object containing both base routes and form paths.
*
* @property {Object} The base routes.
* @property {Object} formPaths - The form paths.
*/
const ROUTES = { ...BASE_ROUTES, formPaths: FORM_ROUTES.formPaths }
}, [stepDataArray && stepDataArray.length])

return (
content &&
ROUTES.formPaths && (
ROUTES?.formPaths && (
<RouteContext.Provider value={ROUTES}>
<LanguageContext.Provider value={t}>
{isDraftMode === true && <Alert>Draft Mode</Alert>}
Expand Down
6 changes: 3 additions & 3 deletions benefit-finder/src/Routes/Intro/_index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '../../shared/styles/breakpoints/_index.scss' as *;
@use '../../shared/styles/sizes/_index.scss' as *;
@use '../../shared/styles/space/_index.scss' as space;
@use '@styles/breakpoints' as *;
@use '@styles/sizes' as *;
@use '@styles/space' as space;

.bf-intro {
padding-bottom: space.$padding-bottom-lg;
Expand Down
12 changes: 6 additions & 6 deletions benefit-finder/src/Routes/LifeEventSection/_index.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@use '../../shared/styles/colors/_index.scss' as color;
@use '../../shared/styles/breakpoints/_index.scss' as *;
@use '../../shared/styles/space/_index.scss' as space;
@use '../../shared/styles/sizes/_index.scss' as *;
@use '../../shared/styles/mixins/_index.scss' as *;
@use '../../shared/styles/functions/_index.scss' as *;
@use '@styles/colors' as color;
@use '@styles/breakpoints' as *;
@use '@styles/space' as space;
@use '@styles/sizes' as *;
@use '@styles/mixins' as *;
@use '@styles/functions' as *;

.bf-usa-form,
.bf-verify-selections-view {
Expand Down
Loading

0 comments on commit 2a13c83

Please sign in to comment.