mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Fix unit tests
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
24d4bad10c
commit
d1c492a0fa
@ -49,7 +49,7 @@ describe('User', () => {
|
||||
|
||||
expect(create).toHaveBeenCalled();
|
||||
expect(createToken).toHaveBeenCalled();
|
||||
expect(result).toStrictEqual(expected);
|
||||
expect(result).toMatchObject(expected);
|
||||
});
|
||||
|
||||
test('Creates a user and hash password if provided', async () => {
|
||||
@ -88,7 +88,7 @@ describe('User', () => {
|
||||
expect(create).toHaveBeenCalled();
|
||||
expect(hashPassword).toHaveBeenCalledWith(input.password);
|
||||
expect(createToken).toHaveBeenCalled();
|
||||
expect(result).toStrictEqual(expected);
|
||||
expect(result).toMatchObject(expected);
|
||||
expect(result.password !== input.password).toBe(true);
|
||||
});
|
||||
|
||||
@ -120,7 +120,7 @@ describe('User', () => {
|
||||
const expected = _.clone(input);
|
||||
const result = await userService.create(input);
|
||||
|
||||
expect(result).toStrictEqual(expected);
|
||||
expect(result).toMatchObject(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@ -289,7 +289,7 @@ describe('User', () => {
|
||||
const res = await userService.findOne(input);
|
||||
|
||||
expect(res).not.toBeNull();
|
||||
expect(res).toStrictEqual(user);
|
||||
expect(res).toMatchObject(user);
|
||||
});
|
||||
|
||||
test('Fails to find a user with provided params', async () => {
|
||||
|
||||
@ -7,7 +7,7 @@ describe('Upload plugin bootstrap function', () => {
|
||||
|
||||
global.strapi = {
|
||||
admin: {
|
||||
services: { permission: { provider: { register } } },
|
||||
services: { permission: { actionProvider: { register } } },
|
||||
},
|
||||
log: {
|
||||
error() {},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user