Skip to content

Commit 5039684

Browse files
committed
add tests for formatting
1 parent 49079d8 commit 5039684

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

packages/validation/src/validation.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ describe('no', () => {
4848
});
4949

5050
test.each([
51-
['12345678903', true],
52-
['12345678901', false],
53-
['9523 08 20059', false],
54-
['95230820052', false],
55-
['9523.08.20059', false],
56-
])('validateAccountNumber(%s) -> %s', (input, expected) => {
57-
expect(no.validateAccountNumber(input)).toBe(expected);
51+
['12345678903', true, undefined],
52+
['12345678901', false, undefined],
53+
['1234 56 78903', false, undefined],
54+
['95230820052', false, undefined],
55+
['9523.08.20059', false, undefined],
56+
57+
['1234 56 78903', true, { allowFormatting: true }],
58+
['1234 56 78903', false, { allowFormatting: false }],
59+
['9523.08.20059', true, { allowFormatting: true }],
60+
['9523.08.20059', false, { allowFormatting: false }],
61+
])('validateAccountNumber(%s) -> %s', (input, expected, options) => {
62+
expect(no.validateAccountNumber(input, options)).toBe(expected);
5863
});
5964

6065
test.each([

0 commit comments

Comments
 (0)