Skip to content

Commit

Permalink
95241 add 'no claim id' and BDD scenarios (#33012)
Browse files Browse the repository at this point in the history
  • Loading branch information
christinec-fftc authored Nov 18, 2024
1 parent bc736b9 commit 8f97b61
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ export function ClaimConfirmationInfo({
dateSubmitted,
conditions,
claimId,
isSubmittingBDD,
}) {
const name = formatFullName(fullName);
return (
<va-summary-box>
<va-summary-box class={isSubmittingBDD && 'vads-u-margin-top--4'}>
<h2 className="vads-u-font-size--h3" slot="headline">
Disability Compensation Claim{' '}
<span className="vads-u-font-weight--normal">(Form 21-526EZ)</span>
Expand All @@ -35,10 +36,12 @@ export function ClaimConfirmationInfo({
))}
</ul>
</li>
<li>
<strong>Claim ID number</strong>
<div>{claimId}</div>
</li>
{claimId && (
<li>
<strong>Claim ID number</strong>
<div>{claimId}</div>
</li>
)}
</ul>
</div>
</va-summary-box>
Expand All @@ -50,4 +53,5 @@ ClaimConfirmationInfo.propTypes = {
conditions: PropTypes.array,
dateSubmitted: PropTypes.object,
fullName: PropTypes.object,
isSubmittingBDD: PropTypes.bool,
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from '../content/confirmation-page';
import { alertBody } from '../content/confirmation-poll';
import { ClaimConfirmationInfo } from '../components/ClaimConfirmationInfo';
import { BddConfirmationAlert } from '../content/bddConfirmationAlert';

export default class ConfirmationPage extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -60,11 +61,13 @@ export default class ConfirmationPage extends React.Component {
actions={<></>}
content={alertBody}
/>
{props.isSubmittingBDD && <BddConfirmationAlert />}
<ClaimConfirmationInfo
claimId={props.claimId}
conditions={props.disabilities}
dateSubmitted={props.submittedAt}
fullName={props.fullName}
isSubmittingBDD={props.isSubmittingBDD}
/>
<ConfirmationView.PrintThisPage />
<ConfirmationView.WhatsNextProcessList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const bddConfirmationHeadline =
export const BddConfirmationAlert = () => {
return (
<div className="vads-u-margin-top--2">
<va-alert status="warning" uswds>
<va-alert status="warning">
<h3 slot="headline">{bddConfirmationHeadline}</h3>
{alertContent}
</va-alert>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,14 @@ describe('ConfirmationPage', () => {
submissionStatus: submissionStatuses.succeeded,
};

const { container, getByText } = render(
const { container, getByText, queryByText } = render(
<Provider store={store}>
<ConfirmationPage {...props} />
</Provider>,
);

expect(queryByText(bddConfirmationHeadline)).to.not.exist;

// success alert
getByText('Form submission started on', { exact: false });
getByText('Your submission is in progress.', {
Expand Down Expand Up @@ -265,5 +267,96 @@ describe('ConfirmationPage', () => {
'Download VA Form 21-686c (opens in new tab)',
);
});

it('should render new confirmation page when submission succeeded with no claim id', () => {
const store = mockStore(
getData({
disability526NewConfirmationPage: true,
}),
);
const props = {
...defaultProps,
submissionStatus: submissionStatuses.succeeded,
};

const { container, getByText, queryByText } = render(
<Provider store={store}>
<ConfirmationPage {...props} />
</Provider>,
);

// success alert
getByText('Form submission started on', { exact: false });
getByText('Your submission is in progress.', {
exact: false,
});

// summary box with claim info
getByText('Disability Compensation Claim');
getByText('For Hector Lee Brooks Sr.');
getByText('Date submitted');
getByText('November 7, 2024');
getByText('Conditions claimed');
getByText('Something Something');
getByText('Unknown Condition');
expect(queryByText('Claim ID number')).to.not.exist;

// rest of sections are present
getByText('Print this confirmation page');
getByText('What to expect');
getByText('How to contact us if you have questions');
getByText('How long will it take VA to make a decision on my claim?');
getByText('If I have dependents, how can I receive additional benefits?');
getByText('Need help?');
expect(container.querySelectorAll('va-link')).to.have.lengthOf(5);
});

it('should render success with BDD SHA alert when submission succeeded with claim id for BDD', () => {
const store = mockStore(
getData({
disability526NewConfirmationPage: true,
}),
);
const props = {
...defaultProps,
claimId: '123456789',
submissionStatus: submissionStatuses.succeeded,
};

const { container, getByText } = render(
<Provider store={store}>
<ConfirmationPage {...props} isSubmittingBDD />
</Provider>,
);

// success alert
getByText('Form submission started on', { exact: false });
getByText('Your submission is in progress.', {
exact: false,
});
getByText(bddConfirmationHeadline);

// summary box with claim info
getByText('Disability Compensation Claim');
getByText('For Hector Lee Brooks Sr.');
getByText('Date submitted');
getByText('November 7, 2024');
getByText('Conditions claimed');
getByText('Something Something');
getByText('Unknown Condition');
getByText('Claim ID number');
getByText(props.claimId);

// rest of sections are present
getByText('Print this confirmation page');
getByText('What to expect');
getByText('How to contact us if you have questions');
getByText('How long will it take VA to make a decision on my claim?');
getByText('If I have dependents, how can I receive additional benefits?');
getByText('Need help?');

// links
expect(container.querySelectorAll('va-link')).to.have.lengthOf(5);
});
});
});

0 comments on commit 8f97b61

Please sign in to comment.