-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
178 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,10 @@ import { | |
} from '@department-of-veterans-affairs/platform-forms-system/ui'; | ||
|
||
import ConfirmationPageV2 from '../../components/ConfirmationPageV2'; | ||
import maxData from '../fixtures/data/maximal-test.json'; | ||
import maxData from '../fixtures/data/maximal-test-v2.json'; | ||
import { EVIDENCE_VA, EVIDENCE_PRIVATE, EVIDENCE_OTHER } from '../../constants'; | ||
|
||
const getData = (customData = {}) => ({ | ||
const getData = (customData = maxData.data) => ({ | ||
user: { | ||
profile: { | ||
userFullName: { | ||
|
@@ -31,7 +32,6 @@ const getData = (customData = {}) => ({ | |
response: new Date().toISOString(), | ||
}, | ||
data: { | ||
...maxData.data, | ||
...customData, | ||
}, | ||
}, | ||
|
@@ -50,7 +50,7 @@ describe('ConfirmationPageV2', () => { | |
expect($('va-alert[status="success"]', container)).to.exist; | ||
|
||
const items = $$('.dd-privacy-hidden[data-dd-action-name]', container); | ||
expect(items.length).to.eq(12); | ||
expect(items.length).to.eq(7); | ||
expect( | ||
items.map( | ||
(el, index) => el[[1, 2].includes(index) ? 'innerHTML' : 'textContent'], | ||
|
@@ -61,11 +61,6 @@ describe('ConfirmationPageV2', () => { | |
'<va-telephone contact="" not-clickable="true"></va-telephone>', | ||
'', | ||
', ', | ||
'Not selected', | ||
'None selected', | ||
'', | ||
'', | ||
'', | ||
'No, I didn’t certify', | ||
'None selected', | ||
]); | ||
|
@@ -105,15 +100,17 @@ describe('ConfirmationPageV2', () => { | |
'New and relevant evidence', | ||
]); | ||
|
||
const h4s = $$('h4', container); | ||
expect(h4s.length).to.eq(3); | ||
expect(h4s.map(el => el.textContent)).to.deep.equal([ | ||
expect($('.va-title', container).textContent).to.eq( | ||
'We’re requesting records from these VA locations:', | ||
); | ||
expect($('.private-title', container).textContent).to.eq( | ||
'We’re requesting records from these non-VA medical providers:', | ||
); | ||
expect($('.upload-title', container).textContent).to.eq( | ||
'You uploaded these documents:', | ||
]); | ||
); | ||
|
||
expect($$('ul', container).length).to.eq(8); | ||
expect($$('ul', container).length).to.eq(7); | ||
|
||
const items = $$('.dd-privacy-hidden[data-dd-action-name]', container); | ||
expect(items.length).to.eq(30); | ||
|
@@ -127,19 +124,19 @@ describe('ConfirmationPageV2', () => { | |
'<va-telephone contact="5558002222" extension="1234" not-clickable="true"></va-telephone>', | ||
'[email protected]', | ||
'123 Main StNew York, NY 30012', | ||
'Not selected', | ||
'None selected', | ||
'', | ||
'', | ||
'', | ||
'No', | ||
'HeadachesDecision date: June 10, 2021', | ||
'TinnitusDecision date: June 1, 2021', | ||
'TestDecision date: January 1, 2022', | ||
'Test 2Decision date: June 28, 2022', | ||
'Yes, I certify', | ||
'None selected', | ||
'A VA Vet center, A community care provider that VA paid for, A VA medical center (also called a VAMC), A community-based outpatient clinic (also called a CBOC), A Department of Defense military treatment facility (also called an MTF), A non-VA healthcare provider, and Lorem ipsum', | ||
'VAMC Location 1', | ||
'Test and Test 2', | ||
'Jan 1, 2001 – Jan 1, 2011', | ||
'January 2001', | ||
'VAMC Location 2', | ||
'Test 2', | ||
'Feb 2, 2002 – Feb 2, 2012', | ||
'February 2001', | ||
'Private Doctor', | ||
'Test and Test 2', | ||
'Jan 1, 2022 – Feb 1, 2022', | ||
|
@@ -154,39 +151,72 @@ describe('ConfirmationPageV2', () => { | |
expect($$('.vads-c-action-link--green', container).length).to.eq(1); | ||
}); | ||
|
||
it('should render the confirmation page with a hearing request', () => { | ||
it('should render the confirmation page with no evidence', () => { | ||
const data = getData({ | ||
boardReviewOption: 'hearing', | ||
hearingTypePreference: 'central_office', | ||
...maxData.data, | ||
facilityTypes: {}, | ||
[EVIDENCE_VA]: false, | ||
[EVIDENCE_PRIVATE]: false, | ||
[EVIDENCE_OTHER]: false, | ||
}); | ||
const { container } = render( | ||
<Provider store={mockStore(data)}> | ||
<ConfirmationPageV2 /> | ||
</Provider>, | ||
); | ||
|
||
const items = $$('.dd-privacy-hidden[data-dd-action-name]', container); | ||
expect(items.length).to.eq(24); | ||
expect(items.map(el => el.textContent).slice(-2)).to.deep.equal([ | ||
'Hearing', | ||
'An in-person hearing at the Board in Washington, D.C.', | ||
expect($('va-alert[status="success"]', container)).to.exist; | ||
expect($('va-alert[status="success"]', container).innerHTML).to.contain( | ||
`Thank you for filing a Supplemental Claim`, | ||
); | ||
// expect($('va-loading-indicator', container)).to.exist; | ||
const h2s = $$('h2', container); | ||
expect(h2s.length).to.eq(4); | ||
expect(h2s.map(el => el.textContent)).to.deep.equal([ | ||
'File a Supplemental Claim', // print only header | ||
'Thank you for filing a Supplemental Claim', | ||
'What to expect next', | ||
'Your Supplemental Claim request', | ||
]); | ||
}); | ||
|
||
it('should render the confirmation page with a direct review', () => { | ||
const data = getData({ | ||
boardReviewOption: 'direct_review', | ||
}); | ||
const { container } = render( | ||
<Provider store={mockStore(data)}> | ||
<ConfirmationPageV2 /> | ||
</Provider>, | ||
const h3s = $$('h3', container); | ||
expect(h3s.length).to.eq(6); // 7 with PDF download code added | ||
expect(h3s.map(el => el.textContent)).to.deep.equal([ | ||
// 'Save a PDF copy of your Supplemental Claim request', | ||
'Print this confirmation page', | ||
'Personal information', | ||
'Living situation', | ||
'Issues for review', | ||
'New and relevant evidence', | ||
'Review the evidence you’re submitting', | ||
]); | ||
|
||
expect($('.no-evidence', container).textContent).to.eq( | ||
'I didn’t add any evidence', | ||
); | ||
|
||
expect($$('ul', container).length).to.eq(4); | ||
|
||
const items = $$('.dd-privacy-hidden[data-dd-action-name]', container); | ||
expect(items.length).to.eq(14); | ||
expect(items.map(el => el.textContent).slice(-1)).to.deep.equal([ | ||
'Direct review', | ||
expect( | ||
items.map((el, index) => el[index === 4 ? 'innerHTML' : 'textContent']), | ||
).to.deep.equal([ | ||
'Michael Thomas Wazowski, Esq.', | ||
'●●●–●●–8765V A file number ending with 8 7 6 5', | ||
'February 3, 1990', | ||
'', | ||
'<va-telephone contact="5558002222" extension="1234" not-clickable="true"></va-telephone>', | ||
'[email protected]', | ||
'123 Main StNew York, NY 30012', | ||
'No', | ||
'HeadachesDecision date: June 10, 2021', | ||
'TinnitusDecision date: June 1, 2021', | ||
'TestDecision date: January 1, 2022', | ||
'Test 2Decision date: June 28, 2022', | ||
'Yes, I certify', | ||
'None selected', | ||
]); | ||
expect($$('.vads-c-action-link--green', container).length).to.eq(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.