mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
added test case to check password validity
This commit is contained in:
parent
e60bf73cc0
commit
1e3d6855cc
@ -114,6 +114,17 @@ describe('Auth', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('invalidatePassword', () => {
|
||||||
|
test('Compares password with hash', async () => {
|
||||||
|
const password = 'pcw123';
|
||||||
|
const password2 = 'pcs1234';
|
||||||
|
const hash = await hashPassword(password2);
|
||||||
|
|
||||||
|
const isValid = await validatePassword(password, hash);
|
||||||
|
expect(isValid).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('forgotPassword', () => {
|
describe('forgotPassword', () => {
|
||||||
test('Only run the process for active users', async () => {
|
test('Only run the process for active users', async () => {
|
||||||
const findOne = jest.fn(() => Promise.resolve());
|
const findOne = jest.fn(() => Promise.resolve());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user