Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ function ReviewIssuesStep({

{remainingAttempts <= DISPLAY_ATTEMPTS && (
<p>
<strong>{t('idv.failure.attempts_html', { count: remainingAttempts })}</strong>
{formatWithStrongNoWrap(
t('idv.failure.attempts_html', { count: remainingAttempts }),
)}
</p>
)}
</Warning>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ describe('document-capture/components/review-issues-step', () => {
new I18n({
strings: {
'idv.failure.attempts_html': {
one: 'One attempt remaining',
other: '%{count} attempts remaining',
one: '<strong>One attempt</strong> remaining',
other: '<strong>%{count} attempts</strong> remaining',
},
},
})
Expand All @@ -56,7 +56,8 @@ describe('document-capture/components/review-issues-step', () => {
);

expect(getByText('errors.doc_auth.throttled_heading')).to.be.ok();
expect(getByText('3 attempts remaining')).to.be.ok();
expect(getByText('3 attempts', { selector: 'strong' })).to.be.ok();
expect(getByText('remaining')).to.be.ok();
expect(getByRole('button', { name: 'idv.failure.button.warning' })).to.be.ok();

expect(
Expand All @@ -68,6 +69,41 @@ describe('document-capture/components/review-issues-step', () => {
}),
).to.exist();
});
it('renders initially with warning page and displays attempts remaining with IPP', () => {
Comment thread
aduth marked this conversation as resolved.
const { getByRole, getByText } = render(
<InPersonContext.Provider value={{ inPersonURL: '/' }}>
<I18nContext.Provider
value={
new I18n({
strings: {
'idv.failure.attempts_html': {
one: '<strong>One attempt</strong> remaining',
other: '<strong>%{count} attempts</strong> remaining',
},
},
})
}
>
<ReviewIssuesStep {...DEFAULT_PROPS} />
</I18nContext.Provider>
</InPersonContext.Provider>,
);

expect(getByText('errors.doc_auth.throttled_heading')).to.be.ok();
expect(getByText('3 attempts', { selector: 'strong' })).to.be.ok();
expect(getByText('remaining')).to.be.ok();
expect(getByRole('button', { name: 'idv.failure.button.try_online' })).to.be.ok();
expect(getByRole('button', { name: 'in_person_proofing.body.cta.button' })).to.be.ok();

expect(
getByRole('link', { name: 'idv.troubleshooting.options.doc_capture_tips links.new_tab' }),
).to.exist();
expect(
getByRole('link', {
name: 'idv.troubleshooting.options.supported_documents links.new_tab',
}),
).to.exist();
});

it('renders warning page with error and displays one attempt remaining then continues on', async () => {
const { getByRole, getByLabelText, getByText } = render(
Expand Down