fix: prettier issue

This commit is contained in:
Bassel Kanso 2024-09-27 11:07:29 +03:00
parent 3959062d73
commit f4fb74d10c
2 changed files with 17 additions and 15 deletions

View File

@ -115,8 +115,10 @@ module.exports = ({ strapi }) => ({
}
const validations = strapi.config.get('plugin::users-permissions.validationRules');
const { currentPassword, password } = await validateChangePasswordBody(validations)(ctx.request.body);
const { currentPassword, password } = await validateChangePasswordBody(validations)(
ctx.request.body
);
const user = await strapi.db
.query('plugin::users-permissions.user')
@ -321,7 +323,7 @@ module.exports = ({ strapi }) => ({
const validations = strapi.config.get('plugin::users-permissions.validationRules');
await validateRegisterBody(validations)(params)
await validateRegisterBody(validations)(params);
const role = await strapi.db
.query('plugin::users-permissions.role')

View File

@ -91,7 +91,7 @@ describe('user-permissions auth', () => {
},
send: jest.fn(),
};
const authorization = auth({ strapi: global.strapi })
const authorization = auth({ strapi: global.strapi });
await authorization.register(ctx);
expect(ctx.send).toHaveBeenCalledTimes(1);
});
@ -124,7 +124,7 @@ describe('user-permissions auth', () => {
},
send: jest.fn(),
};
const authorization = auth({ strapi: global.strapi })
const authorization = auth({ strapi: global.strapi });
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
expect(ctx.send).toHaveBeenCalledTimes(0);
});
@ -157,7 +157,7 @@ describe('user-permissions auth', () => {
},
send: jest.fn(),
};
const authorization = auth({ strapi: global.strapi })
const authorization = auth({ strapi: global.strapi });
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
expect(ctx.send).toHaveBeenCalledTimes(0);
});
@ -190,7 +190,7 @@ describe('user-permissions auth', () => {
},
send: jest.fn(),
};
const authorization = auth({ strapi: global.strapi })
const authorization = auth({ strapi: global.strapi });
await authorization.register(ctx);
expect(ctx.send).toHaveBeenCalledTimes(1);
});
@ -222,7 +222,7 @@ describe('user-permissions auth', () => {
},
send: jest.fn(),
};
const authorization = auth({ strapi: global.strapi })
const authorization = auth({ strapi: global.strapi });
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
expect(ctx.send).toHaveBeenCalledTimes(0);
});
@ -232,12 +232,12 @@ describe('user-permissions auth', () => {
...mockStrapi,
config: {
get: jest.fn((path) => {
if (path === 'plugin::users-permissions.validationRules'){
if (path === 'plugin::users-permissions.validationRules') {
return {
password:{
min:1,
}
}
password: {
min: 1,
},
};
}
return {
register: {
@ -261,8 +261,8 @@ describe('user-permissions auth', () => {
},
send: jest.fn(),
};
const authorization = auth({ strapi: global.strapi })
await authorization.register(ctx)
const authorization = auth({ strapi: global.strapi });
await authorization.register(ctx);
expect(ctx.send).toHaveBeenCalledTimes(1);
});
});