Skip to content

Commit

Permalink
update a test to verify diff coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffGreiner-eaton committed Mar 29, 2024
1 parent 9e33485 commit 91c4b92
Showing 1 changed file with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ const passwordRequirements = [
description: 'Check 2',
regex: /[a-z]+/,
},
{
description: '8-16 Characters',
regex: /^.{8,16}$/,
},
{
description: 'One number',
regex: /\d+/,
},
{
description: 'One uppercase letter',
regex: /[A-Z]+/,
},
{
description: 'One lowercase letter',
regex: /[a-z]+/,
},
{
description: 'One special character',
regex: /[!@#$%^&*(),.?":{}|<>]+/,
},
];

afterEach(cleanup);
Expand Down Expand Up @@ -146,4 +166,39 @@ describe('Create Password Screen', () => {
fireEvent.click(backButton);
expect(mockOnPrevious).toHaveBeenCalled();
});

it('renders with custom and default password requirements', () => {
renderer();

expect(passwordRequirements).toEqual([
{
description: 'Check 1',
regex: /^.{3,5}$/,
},
{
description: 'Check 2',
regex: /[a-z]+/,
},
{
description: '8-16 Characters',
regex: /^.{8,16}$/,
},
{
description: 'One number',
regex: /\d+/,
},
{
description: 'One uppercase letter',
regex: /[A-Z]+/,
},
{
description: 'One lowercase letter',
regex: /[a-z]+/,
},
{
description: 'One special character',
regex: /[!@#$%^&*(),.?":{}|<>]+/,
},
]);
});
});

0 comments on commit 91c4b92

Please sign in to comment.