Skip to content

Commit

Permalink
Merge pull request #1913 from GSA/1567-data-attributes-selectors-updated
Browse files Browse the repository at this point in the history
1567 data attributes selectors updated
  • Loading branch information
scottqueen-bixal authored Nov 5, 2024
2 parents dee022f + 4d0b43a commit 42e6f5a
Show file tree
Hide file tree
Showing 18 changed files with 316 additions and 314 deletions.
21 changes: 12 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
.applicantDateOfBirthMonth()
.fieldsetById(relationshipId)
.invoke('attr', 'aria-invalid')
.should('eq', 'false')

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

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

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

pageObjects
.applicantDateOfBirthYear()
.benefitMemorableDateById('day')
.invoke('attr', 'aria-invalid')
.should('eq', 'true')
})
Expand All @@ -54,23 +57,23 @@ describe('Validate state of aria-invalid attribute', () => {
pageObjects.button().contains(EN_LOCALE_DATA.buttonGroup[1].value).click()

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

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

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

pageObjects
.applicantDateOfBirthYear()
.benefitMemorableDateById('day')
.invoke('attr', 'aria-invalid')
.should('eq', 'false')
})
Expand Down
Loading

0 comments on commit 42e6f5a

Please sign in to comment.