|
1 |
| -import { checkStrength, scorePassword } from "@/logic"; |
2 |
| -import { risky, guessable, weak, safe, secure } from "../password-examples"; |
3 |
| - |
4 |
| -describe("checkStrength", () => { |
5 |
| - it("return risky", () => { |
6 |
| - expect(checkStrength(risky)).toBe("risky"); |
7 |
| - }); |
8 |
| - |
9 |
| - it("return guessable", () => { |
10 |
| - expect(checkStrength(guessable)).toBe("guessable"); |
11 |
| - }); |
12 |
| - |
13 |
| - it("return weak", () => { |
14 |
| - expect(checkStrength(weak)).toBe("weak"); |
15 |
| - }); |
16 |
| - |
17 |
| - it("return safe", () => { |
18 |
| - expect(checkStrength(safe)).toBe("safe"); |
19 |
| - }); |
20 |
| - |
21 |
| - it("return secure", () => { |
22 |
| - expect(checkStrength(secure)).toBe("secure"); |
23 |
| - }); |
24 |
| -}); |
25 |
| - |
26 |
| -describe("scorePassword", () => { |
27 |
| - it("return risky = 0", () => { |
28 |
| - expect(scorePassword(risky)).toBe(0); |
29 |
| - }); |
30 |
| - |
31 |
| - it("return guessable = 1", () => { |
32 |
| - expect(scorePassword(guessable)).toBe(1); |
33 |
| - }); |
34 |
| - |
35 |
| - it("return weak = 2", () => { |
36 |
| - expect(scorePassword(weak)).toBe(2); |
37 |
| - }); |
38 |
| - |
39 |
| - it("return safe = 3", () => { |
40 |
| - expect(scorePassword(safe)).toBe(3); |
41 |
| - }); |
42 |
| - |
43 |
| - it("return secure = 4", () => { |
44 |
| - expect(scorePassword(secure)).toBe(4); |
45 |
| - }); |
46 |
| -}); |
| 1 | +import { checkStrength, scorePassword } from '@/logic' |
| 2 | +import { risky, guessable, weak, safe, secure } from '../password-examples' |
| 3 | + |
| 4 | +describe('checkStrength', () => { |
| 5 | + it('return risky', () => { |
| 6 | + expect(checkStrength(risky)).toBe('risky') |
| 7 | + }) |
| 8 | + |
| 9 | + it('return guessable', () => { |
| 10 | + expect(checkStrength(guessable)).toBe('guessable') |
| 11 | + }) |
| 12 | + |
| 13 | + it('return weak', () => { |
| 14 | + expect(checkStrength(weak)).toBe('weak') |
| 15 | + }) |
| 16 | + |
| 17 | + it('return safe', () => { |
| 18 | + expect(checkStrength(safe)).toBe('safe') |
| 19 | + }) |
| 20 | + |
| 21 | + it('return secure', () => { |
| 22 | + expect(checkStrength(secure)).toBe('secure') |
| 23 | + }) |
| 24 | +}) |
| 25 | + |
| 26 | +describe('scorePassword', () => { |
| 27 | + it('return risky = 0', () => { |
| 28 | + expect(scorePassword(risky)).toBe(0) |
| 29 | + }) |
| 30 | + |
| 31 | + it('return guessable = 1', () => { |
| 32 | + expect(scorePassword(guessable)).toBe(1) |
| 33 | + }) |
| 34 | + |
| 35 | + it('return weak = 2', () => { |
| 36 | + expect(scorePassword(weak)).toBe(2) |
| 37 | + }) |
| 38 | + |
| 39 | + it('return safe = 3', () => { |
| 40 | + expect(scorePassword(safe)).toBe(3) |
| 41 | + }) |
| 42 | + |
| 43 | + it('return secure = 4', () => { |
| 44 | + expect(scorePassword(secure)).toBe(4) |
| 45 | + }) |
| 46 | +}) |
0 commit comments