Skip to content

Commit 77d3fdf

Browse files
feat: added error config for duplicate-doc (#12591)
* feat: added error config for duplicate-doc * refactor: added testcase * refactor: added testcase
1 parent 5a0214d commit 77d3fdf

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/shared/src/utils/constants/poi-failure-codes.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ export const ONFIDO_ERROR_STATUS: TOnfidoErrorStatus = Object.freeze({
171171
code: 'DataValidationNoDocumentNumbers',
172172
message: <Localize i18n_default_text='The serial number of your document couldn’t be verified.' />,
173173
},
174+
DuplicatedDocument: {
175+
code: 'DuplicatedDocument',
176+
message: <Localize i18n_default_text='Your verification documents were already used for another account.' />,
177+
},
174178
Expired: { code: 'Expired', message: <Localize i18n_default_text='Your document has expired.' /> },
175179
ImageIntegrityColourPicture: {
176180
code: 'ImageIntegrityColourPicture',

packages/shared/src/utils/helpers/__tests__/format-response.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,9 @@ describe('format-response', () => {
217217
])
218218
).toHaveLength(3);
219219
});
220+
221+
it('should return the rest of error codes if status is not Expired', () => {
222+
expect(formatOnfidoError(STATUS_CODES.REJECTED, ['DuplicatedDocument'])).toHaveLength(1);
223+
});
220224
});
221225
});

0 commit comments

Comments
 (0)