Skip to content

Commit cc8c6cc

Browse files
committed
test(utils): added test to isEqual method
1 parent d6aaf0b commit cc8c6cc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/utils/password.value-object.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ describe('password.value-object', () => {
6767
expect(isEncrypted).toBe(false);
6868
});
6969

70+
it('should not generate equal password', () => {
71+
const passA = PasswordValueObject.random(12);
72+
const passB = PasswordValueObject.random(12);
73+
const isEqual = passA.isEqual(passB);
74+
expect(isEqual).toBe(false);
75+
});
76+
77+
it('should password to be equal', () => {
78+
const passA = PasswordValueObject.random(12);
79+
const passB = passA.clone().value();
80+
const isEqual = passA.isEqual(passB);
81+
expect(isEqual).toBe(true);
82+
});
83+
7084
it('should generate a valid random password not encrypted default 12 chars', () => {
7185
const result = PasswordValueObject.random();
7286
const isEncrypted = result.isEncrypted();

0 commit comments

Comments
 (0)