-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
barosanuemailtest
committed
Feb 3, 2023
1 parent
635fddc
commit f8618d6
Showing
2 changed files
with
42 additions
and
7 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 |
---|---|---|
@@ -1,17 +1,43 @@ | ||
import { PasswordChecker } from "../../app/pass_checker/PasswordChecker" | ||
|
||
|
||
describe('PasswordChecker test suite', ()=>{ | ||
describe('PasswordChecker test suite', () => { | ||
|
||
let sut: PasswordChecker; | ||
|
||
beforeEach(()=>{ | ||
beforeEach(() => { | ||
sut = new PasswordChecker(); | ||
}) | ||
|
||
it('Should do nothing for the moment', ()=>{ | ||
sut.checkPassword(); | ||
}) | ||
it('Password with less than 8 chars is invalid', () => { | ||
const actual = sut.checkPassword('1234567'); | ||
expect(actual).toBe(false); | ||
}); | ||
|
||
it('Password with more than 8 chars is ok', () => { | ||
const actual = sut.checkPassword('12345678Aa'); | ||
expect(actual).toBe(true); | ||
}); | ||
|
||
it('Password with no upper case letter is invalid', () => { | ||
const actual = sut.checkPassword('1234abcd'); | ||
expect(actual).toBe(false); | ||
}); | ||
|
||
it('Password with upper case letter is valid', () => { | ||
const actual = sut.checkPassword('1234abcdA'); | ||
expect(actual).toBe(true); | ||
}); | ||
|
||
it('Password with no lower case letter is invalid', () => { | ||
const actual = sut.checkPassword('1234ABCD'); | ||
expect(actual).toBe(false); | ||
}); | ||
|
||
it('Password with lower case letter is valid', () => { | ||
const actual = sut.checkPassword('1234ABCDa'); | ||
expect(actual).toBe(true); | ||
}); | ||
|
||
|
||
}) |