Skip to content

Commit

Permalink
Merge pull request #2007 from GSA/1983-spell-checker-updates
Browse files Browse the repository at this point in the history
1983 spell checker updates
  • Loading branch information
scottqueen-bixal authored Dec 13, 2024
2 parents ec6e8c3 + c2ad030 commit 9fa671d
Show file tree
Hide file tree
Showing 61 changed files with 1,448 additions and 277 deletions.
30 changes: 30 additions & 0 deletions benefit-finder/.cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": [
"node_modules",
"themes",
"storybook-static",
"dist",
"coverage",
"build",
"src/shared/locales/es/es.json"
],
"language": "en",
"dictionaryDefinitions": [
{ "name": "content", "path": "./cspell-dictionary/content.txt" },
{ "name": "dev", "path": "./cspell-dictionary/dev.txt" },
{ "name": "es", "path": "./cspell-dictionary/es.txt" },
{ "name": "project", "path": "./cspell-dictionary/project.txt" }
],
"dictionaries": [
"html",
"bash",
"css",
"node",
"content",
"dev",
"es",
"project"
]
}
3 changes: 3 additions & 0 deletions benefit-finder/.lintstagedrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
],
"src/**/*.scss": [
"stylelint --fix"
],
"**": [
"cspell lint"
]
}
2 changes: 1 addition & 1 deletion benefit-finder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ We take a utility first approach. We do not have full control over our styles si

1. we establish uswds components with `usa-<class>` classes.
2. this inherits global `uswds` `css` and `js`
3. IF we need to overide, we clone the uswds class `usa-` and prepend `bf-`.
3. IF we need to override, we clone the uswds class `usa-` and prepend `bf-`.

```css
.bf-usa-<class> .usa-<class>
Expand Down
4 changes: 4 additions & 0 deletions benefit-finder/cspell-dictionary/content.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DOLO
FEMA
FASS
CHAMPVA
40 changes: 40 additions & 0 deletions benefit-finder/cspell-dictionary/dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
autodocs
camelcase
esbenp
fieldgroup
fieldset
fieldsets
firstname
lastname
stylelint
backcta
spacebar
pageup
pagedown
icongallery
skipnav
Vitest
labelledby
tabindex
stylesheet
hreflang
evenodd
checkmark
inputmode
datetype
describedby
noreferrer
noopener
lede
nbsp
httpstat
prestart
pagesurvey
Pagesub
ALLOWALL
cflinuxfs
buildpack
buildpacks
webfonts
hkshshslhshjksh
kjgljjlhkhgljgjh
16 changes: 16 additions & 0 deletions benefit-finder/cspell-dictionary/es.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
inglés
enero
Aplicar
beneficio
beneficios
buscador
discapacidad
jubilacion
suma
muerte
elegible
resultados
selecciónes
revisar
casada
Hija
2 changes: 2 additions & 0 deletions benefit-finder/cspell-dictionary/project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usagov
uswds
4 changes: 2 additions & 2 deletions benefit-finder/cypress/e2e/storybook/axe-a11y.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="Cypress" />

import * as utils from '../../support/utils.js'
import * as BENEFITS_ELIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import * as BENEFITS_ELIGIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import * as EN_LOCALE_DATA from '../../../../benefit-finder/src/shared/locales/en/en.json'
import * as EN_DOLO_MOCK_DATA from '../../../../benefit-finder/src/shared/api/mock-data/current.json'
import { pageObjects } from '../../support/pageObjects'
Expand Down Expand Up @@ -114,7 +114,7 @@ describe(`Validate code passes axe scanning`, () => {
})

it('Has no detectable a11y violations on see benefits', () => {
const selectedData = BENEFITS_ELIBILITY_DATA.scenario_1_covid.en.param
const selectedData = BENEFITS_ELIGIBILITY_DATA.scenario_1_covid.en.param
const scenario = utils.encodeURIFromObject(selectedData)

cy.visit(`${utils.storybookUri}${scenario}`)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as utils from '../../support/utils'
import * as BENEFITS_ELIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import * as BENEFITS_ELIGIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import { pageObjects } from '../../support/pageObjects'

beforeEach(() => {
const selectedData = BENEFITS_ELIBILITY_DATA.scenario_1_covid.en.param
const selectedData = BENEFITS_ELIGIBILITY_DATA.scenario_1_covid.en.param
const scenario = utils.encodeURIFromObject(selectedData)
cy.visit(`${utils.storybookUri}${scenario}`)
pageObjects.accordionHeading().should('exist')
Expand Down
30 changes: 15 additions & 15 deletions benefit-finder/cypress/e2e/storybook/dataLayer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as utils from '../../support/utils.js'
import { dataLayerUtils } from '../../../src/shared/utils'
import { pageObjects } from '../../support/pageObjects'
import * as EN_LOCALE_DATA from '../../../../benefit-finder/src/shared/locales/en/en.json'
import * as BENEFITS_ELIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import * as BENEFITS_ELIGIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import content from '../../../src/shared/api/mock-data/current.json'
import * as EN_DOLO_MOCK_DATA from '../../../../benefit-finder/src/shared/api/mock-data/current.json'

Expand All @@ -17,12 +17,12 @@ const {
openAllBenefitAccordions,
} = dataLayerUtils.dataLayerStructure
const { lifeEventForm } = content.data
const selectedData = BENEFITS_ELIBILITY_DATA.scenario_1_covid.en.param
const enResults = BENEFITS_ELIBILITY_DATA.scenario_1_covid.en.results
const zero_benefit_view = BENEFITS_ELIBILITY_DATA.zero_benefit_view.en.results
const selectedData = BENEFITS_ELIGIBILITY_DATA.scenario_1_covid.en.param
const enResults = BENEFITS_ELIGIBILITY_DATA.scenario_1_covid.en.results
const zero_benefit_view = BENEFITS_ELIGIBILITY_DATA.zero_benefit_view.en.results
const scenario = utils.encodeURIFromObject(selectedData)

// calculate out elibibility counts we expect for our event values
// calculate out eligibility counts we expect for our event values
const eligibilityCount = {
eligibleBenefitCount: {
number: enResults.eligible.length,
Expand Down Expand Up @@ -146,7 +146,7 @@ const dataLayerValueFormCompletionModal = {
},
}

const dataLayerValueVerifySecletions = {
const dataLayerValueVerifySelections = {
event: 'bf_page_change',
bfData: {
pageView: 'bf-verify-selections',
Expand Down Expand Up @@ -181,7 +181,7 @@ const dataLayerValues = [
dataLayerValueFormStepTwo,
dataLayerValueFormCompletionModal,
dataLayerValueFormSubmitSuccess,
dataLayerValueVerifySecletions,
dataLayerValueVerifySelections,
dataLayerValueZeroResultsViewEligible,
dataLayerValueZeroResultsViewNotEligible,
dataLayerValueOpenAllAccordions,
Expand Down Expand Up @@ -273,7 +273,7 @@ describe('Calls to Google Analytics Object', function () {
})
})

it('second form step bf_page_change event, asserts incrmenting values', function () {
it('second form step bf_page_change event, asserts incrementing values', function () {
cy.visit(utils.storybookUri)

cy.navigateToAboutTheApplicantPage()
Expand Down Expand Up @@ -613,12 +613,12 @@ describe('Calls to Google Analytics Object', function () {
// get all the events in our layer that matches the event value
const ev = [
...window.dataLayer.filter(
x => x?.event === dataLayerValueVerifySecletions.event
x => x?.event === dataLayerValueVerifySelections.event
),
]
removeID(ev[4])

expect(ev[4]).to.deep.equal(dataLayerValueVerifySecletions)
expect(ev[4]).to.deep.equal(dataLayerValueVerifySelections)
})
})
})
Expand Down Expand Up @@ -718,12 +718,12 @@ describe('Calls to Google Analytics Object', function () {
// get all the events in our layer that matches the event value
const ev = [
...window.dataLayer.filter(
x => x?.event === dataLayerValueVerifySecletions.event
x => x?.event === dataLayerValueVerifySelections.event
),
]
removeID(ev[4])

expect(ev[4]).to.deep.equal(dataLayerValueVerifySecletions)
expect(ev[4]).to.deep.equal(dataLayerValueVerifySelections)

cy.clickButton(EN_LOCALE_DATA.buttonGroup[1].value).then(() => {
// get all the events in our layer that matches the event value
Expand Down Expand Up @@ -821,14 +821,14 @@ describe('Calls to Google Analytics Object', function () {
cy.clickButton('Review your selections').then(() => {
const ev = [
...window.dataLayer.filter(
x => x?.event === dataLayerValueVerifySecletions.event
x => x?.event === dataLayerValueVerifySelections.event
),
]

// delete ev[4]['gtm.uniqueEventId']
removeID(ev[4])

expect(ev[4]).to.deep.equal(dataLayerValueVerifySecletions)
expect(ev[4]).to.deep.equal(dataLayerValueVerifySelections)

cy.clickButton(EN_LOCALE_DATA.buttonGroup[1].value).then(() => {
const ev = [
Expand Down Expand Up @@ -891,7 +891,7 @@ describe('Calls to Google Analytics Object', function () {
),
]

// we ignore dedup here so there can be multiple fires
// we ignore dedupe here so there can be multiple fires
removeID(ev[1])

expect(ev[1].bfData.accordionsOpen).to.equal(
Expand Down
12 changes: 6 additions & 6 deletions benefit-finder/cypress/e2e/storybook/error-message-display.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,27 +199,27 @@ describe('Validate correct error messages display for negative scenarios', () =>
it('Should validate error label content overrides', () => {
cy.clickButton(EN_LOCALE_DATA.buttonGroup[1].value)

const relationErrorMessageOvveride =
const relationErrorMessageOverride =
EN_DOLO_MOCK_DATA.data.lifeEventForm.sectionsEligibilityCriteria[0]
.section.fieldsets[1].fieldset.errorMessage
pageObjects
.errorDescription()
.eq(1)
.should('be.visible')
.and('contain.text', relationErrorMessageOvveride)
.and('contain.text', relationErrorMessageOverride)

pageObjects
.errorDescription()
.eq(0)
.should('not.contain.text', relationErrorMessageOvveride)
.should('not.contain.text', relationErrorMessageOverride)
pageObjects
.dateOfBirthMonthError()
.should('not.contain.text', relationErrorMessageOvveride)
.should('not.contain.text', relationErrorMessageOverride)
pageObjects
.dateOfBirthDayError()
.should('not.contain.text', relationErrorMessageOvveride)
.should('not.contain.text', relationErrorMessageOverride)
pageObjects
.dateOfBirthYearError()
.should('not.contain.text', relationErrorMessageOvveride)
.should('not.contain.text', relationErrorMessageOverride)
})
})
4 changes: 2 additions & 2 deletions benefit-finder/cypress/e2e/storybook/openAllAccordions.cy.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as utils from '../../support/utils'
import { pageObjects } from '../../support/pageObjects'
import * as BENEFITS_ELIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import * as BENEFITS_ELIGIBILITY_DATA from '../../fixtures/benefits-eligibility.json'

beforeEach(() => {
const selectedData = BENEFITS_ELIBILITY_DATA.scenario_1_covid.en.param
const selectedData = BENEFITS_ELIGIBILITY_DATA.scenario_1_covid.en.param
const scenario = utils.encodeURIFromObject(selectedData)
cy.visit(`${utils.storybookUri}${scenario}`)
pageObjects.accordionHeading().should('exist')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import * as utils from '../../support/utils'
import * as EN_DOLO_MOCK_DATA from '../../../../benefit-finder/src/shared/api/mock-data/current.json'
import * as BENEFITS_ELIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import * as BENEFITS_ELIGIBILITY_DATA from '../../fixtures/benefits-eligibility.json'
import content from '../../../../benefit-finder/src/shared/api/mock-data/current.js'
import * as EN_LOCALE_DATA from '../../../../benefit-finder/src/shared/locales/en/en.json'
const { data } = JSON.parse(content)
Expand Down Expand Up @@ -31,7 +31,7 @@ const publicSafetyOfficerId =
.fieldsets[3].fieldset.inputs[0].inputCriteria.id

describe('Validate correct eligibility benefits display based on selected criteria/options', () => {
it('Should render Survivor Benefits for Child benefit accordion correctly based on selected cretiria options', () => {
it('Should render Survivor Benefits for Child benefit accordion correctly based on selected criteria options', () => {
cy.visit(utils.storybookUri)

cy.navigateToBenefitResultsPage({
Expand All @@ -56,8 +56,8 @@ describe('Validate correct eligibility benefits display based on selected criter
})

it('qa scenario 1 Covid EN - Verify correct benefit results for query values that includes covid in search parameter of URL', () => {
const selectedData = BENEFITS_ELIBILITY_DATA.scenario_1_covid.en.param
const enResults = BENEFITS_ELIBILITY_DATA.scenario_1_covid.en.results
const selectedData = BENEFITS_ELIGIBILITY_DATA.scenario_1_covid.en.param
const enResults = BENEFITS_ELIGIBILITY_DATA.scenario_1_covid.en.results
const scenario = utils.encodeURIFromObject(selectedData)
delete selectedData.shared // We don't want to include the "shared" param
const selectDataLength = Object.keys(selectedData).length
Expand All @@ -82,8 +82,8 @@ describe('Validate correct eligibility benefits display based on selected criter
})

it('QA scenario 2 Veteran EN - Verify correct benefit results for query values that includes veteran in search parameter of URL', () => {
const selectedData = BENEFITS_ELIBILITY_DATA.scenario_2_veteran.en.param
const enResults = BENEFITS_ELIBILITY_DATA.scenario_2_veteran.en.results
const selectedData = BENEFITS_ELIGIBILITY_DATA.scenario_2_veteran.en.param
const enResults = BENEFITS_ELIGIBILITY_DATA.scenario_2_veteran.en.results
const scenario = utils.encodeURIFromObject(selectedData)

cy.visit(`${utils.storybookUri}${scenario}`)
Expand All @@ -97,8 +97,8 @@ describe('Validate correct eligibility benefits display based on selected criter
})

it('QA scenario 3 Coal Miner EN - Verify correct benefit results for query values that includes Coal Miner in search parameter of URL', () => {
const selectedData = BENEFITS_ELIBILITY_DATA.scenario_3_coal_miner.en.param
const enResults = BENEFITS_ELIBILITY_DATA.scenario_3_coal_miner.en.results
const selectedData = BENEFITS_ELIGIBILITY_DATA.scenario_3_coal_miner.en.param
const enResults = BENEFITS_ELIGIBILITY_DATA.scenario_3_coal_miner.en.results
const scenario = utils.encodeURIFromObject(selectedData)

cy.visit(`${utils.storybookUri}${scenario}`)
Expand All @@ -111,15 +111,15 @@ describe('Validate correct eligibility benefits display based on selected criter
})

it('Should display green check icons on eligible benefits', () => {
const selectedData = BENEFITS_ELIBILITY_DATA.scenario_2_veteran.en.param
const selectedData = BENEFITS_ELIGIBILITY_DATA.scenario_2_veteran.en.param
const scenario = utils.encodeURIFromObject(selectedData)
cy.visit(`${utils.storybookUri}${scenario}`)
cy.validateGreenCheckIcons(selectedData)
})

it('Should display Zero benefit view when no benefit are eligible', () => {
const selectedData = BENEFITS_ELIBILITY_DATA.zero_benefit_view.en.param
const enResults = BENEFITS_ELIBILITY_DATA.zero_benefit_view.en.results
const selectedData = BENEFITS_ELIGIBILITY_DATA.zero_benefit_view.en.param
const enResults = BENEFITS_ELIGIBILITY_DATA.zero_benefit_view.en.results
const scenario = utils.encodeURIFromObject(selectedData)
cy.visit(`${utils.storybookUri}${scenario}`)

Expand Down
Loading

0 comments on commit 9fa671d

Please sign in to comment.