-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added bal meta clefInterop retrieval and check in export from postgre…
…s to mongo
- Loading branch information
1 parent
ffbfb59
commit 3760aa5
Showing
2 changed files
with
112 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {checkIfCleInteropIsValid} from './format-to-legacy-helpers.js' | ||
|
||
describe('checkIfCleInteropIsValid', () => { | ||
test('should return false for an empty string', () => { | ||
expect(checkIfCleInteropIsValid('')).toBe(false) | ||
}) | ||
|
||
test('should return false for a null value', () => { | ||
expect(checkIfCleInteropIsValid(null)).toBe(false) | ||
}) | ||
|
||
test('should return false for a string with "xxxx" as the street code', () => { | ||
expect(checkIfCleInteropIsValid('31555_xxxx_00001')).toBe(false) | ||
}) | ||
|
||
test('should return false for a string not matching the pattern', () => { | ||
expect(checkIfCleInteropIsValid('315_7172_00001')).toBe(false) | ||
expect(checkIfCleInteropIsValid('31555_7172a_00001')).toBe(false) | ||
expect(checkIfCleInteropIsValid('31555_ilwhc0_000001')).toBe(false) | ||
expect(checkIfCleInteropIsValid('31555_ilwhc0_0000a')).toBe(false) | ||
expect(checkIfCleInteropIsValid('31555_Ilwhc0_00001')).toBe(false) | ||
}) | ||
|
||
test('should return false for a string with invalid characters', () => { | ||
expect(checkIfCleInteropIsValid('31555_ilwhc#_00001')).toBe(false) | ||
expect(checkIfCleInteropIsValid('31555_ilwhc!_00001')).toBe(false) | ||
}) | ||
|
||
test('should return true for a string matching the pattern', () => { | ||
expect(checkIfCleInteropIsValid('31555_ilwhc0_00001')).toBe(true) | ||
expect(checkIfCleInteropIsValid('31555_7172_00001')).toBe(true) | ||
expect(checkIfCleInteropIsValid('31555_7172_00001_bis')).toBe(true) | ||
expect(checkIfCleInteropIsValid('31555_7172_00001_a1')).toBe(true) | ||
expect(checkIfCleInteropIsValid('31555_7172_00001_bât. a')).toBe(true) | ||
}) | ||
}) |