Fix unit tests

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre Bodin 2020-06-18 11:36:28 +02:00
parent 24d4bad10c
commit d1c492a0fa
2 changed files with 5 additions and 5 deletions

View File

@ -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 () => {

View File

@ -7,7 +7,7 @@ describe('Upload plugin bootstrap function', () => {
global.strapi = {
admin: {
services: { permission: { provider: { register } } },
services: { permission: { actionProvider: { register } } },
},
log: {
error() {},