Skip to content

Commit 5b3e73b

Browse files
committed
Added test cases that fail france locale postal code limitations
1 parent 12b27a2 commit 5b3e73b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/validators.test.js

+27
Original file line numberDiff line numberDiff line change
@@ -12947,6 +12947,7 @@ describe('Validators', () => {
1294712947
'29923-329393-2324',
1294812948
'4294924224',
1294912949
'13',
12950+
1295012951
],
1295112952
args: ['any'],
1295212953
});
@@ -12963,6 +12964,32 @@ describe('Validators', () => {
1296312964
});
1296412965
});
1296512966

12967+
it('should validate a valid French postal code 75001', () => {
12968+
test({
12969+
validator: 'isPostalCode',
12970+
args: ['75001', 'FR'], // Valid postal code with locale
12971+
expected: true,
12972+
});
12973+
});
12974+
12975+
it('should return false for an invalid French postal code 96000', () => {
12976+
test({
12977+
validator: 'isPostalCode',
12978+
args: ['96000', 'FR'], // Invalid postal code with locale
12979+
expected: false,
12980+
});
12981+
});
12982+
12983+
it('should return false for an invalid French postal code 12345', () => {
12984+
test({
12985+
validator: 'isPostalCode',
12986+
args: ['12345', 'FR'], // Another invalid postal code with locale
12987+
expected: false,
12988+
});
12989+
});
12990+
12991+
12992+
1296612993
it('should validate MIME types', () => {
1296712994
test({
1296812995
validator: 'isMimeType',

0 commit comments

Comments
 (0)