-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dernier organisme uai en cohérence avec tous les cas sifa (+ tes…
…ts de non-régression) (#3416)
- Loading branch information
1 parent
0debdc9
commit fbaec68
Showing
4 changed files
with
42 additions
and
3 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
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
34 changes: 34 additions & 0 deletions
34
server/tests/integration/common/constants/validation.test.ts
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,34 @@ | ||
import { DERNIER_ORGANISME_UAI_REGEX } from "@/common/constants/validations"; | ||
|
||
describe("Regex DERNIER_ORGANISME_UAI_REGEX", () => { | ||
describe("Cas valides", () => { | ||
const validValues = [ | ||
"44", | ||
"044", | ||
"95", | ||
"095", | ||
"2B", | ||
"02B", | ||
"972", | ||
"986", | ||
"990", | ||
"991", | ||
"993", | ||
"995", | ||
"0802004U", | ||
"4422672E", | ||
"0755805C", | ||
]; | ||
|
||
it.each(validValues)('"%s" devrait être valide', (value) => { | ||
expect(DERNIER_ORGANISME_UAI_REGEX.test(value)).toBeTruthy(); | ||
}); | ||
}); | ||
describe("Cas invalides", () => { | ||
const invalidValues = ["123", "ABC", "97Z", "9865", "9900", "99123", "ABCD", "1234567890", "0X0X0X"]; | ||
|
||
it.each(invalidValues)('"%s" devrait être invalide', (value) => { | ||
expect(DERNIER_ORGANISME_UAI_REGEX.test(value)).toBeFalsy(); | ||
}); | ||
}); | ||
}); |