Skip to content

Commit

Permalink
separate test into partial and full
Browse files Browse the repository at this point in the history
  • Loading branch information
ins0 committed Jul 25, 2024
1 parent 9f181cc commit b565806
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/policy/Policy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ describe(Policy.name, () => {
});
});
describe("End-To-End", () => {
test("validate a pw against examplePolicy.yaml", () => {
const decl = new LocalPolicyYamlLoader("test").loadPolicy("testPolicy");
test("validate a pw against examplePolicyFull.yaml", () => {
const decl = new LocalPolicyYamlLoader("test").loadPolicy("testPolicyFull");
const policy = Policy.fromDeclaration(decl);
const result = policy.validate("foo12");

Expand Down
26 changes: 26 additions & 0 deletions test/testPolicyFull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
rules:
- ruleType: length
min: 8
max: 64

- ruleType: regex
pattern: "^\\."
translationKey: "beginsWithDot"
max: 0

- ruleType: charPool
charPools:
- special
- numbers
min: 3

- ruleType: char
chars: "#!"

- ruleType: blocklist
blocklist:
- "geheim"
- "passwort"
- "password"
- "123"
substringMatch: true

0 comments on commit b565806

Please sign in to comment.