mirror of
https://github.com/strapi/strapi.git
synced 2025-09-01 04:42:58 +00:00
fix: prettier issue
This commit is contained in:
parent
3959062d73
commit
f4fb74d10c
@ -116,7 +116,9 @@ module.exports = ({ strapi }) => ({
|
|||||||
|
|
||||||
const validations = strapi.config.get('plugin::users-permissions.validationRules');
|
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
|
const user = await strapi.db
|
||||||
.query('plugin::users-permissions.user')
|
.query('plugin::users-permissions.user')
|
||||||
@ -321,7 +323,7 @@ module.exports = ({ strapi }) => ({
|
|||||||
|
|
||||||
const validations = strapi.config.get('plugin::users-permissions.validationRules');
|
const validations = strapi.config.get('plugin::users-permissions.validationRules');
|
||||||
|
|
||||||
await validateRegisterBody(validations)(params)
|
await validateRegisterBody(validations)(params);
|
||||||
|
|
||||||
const role = await strapi.db
|
const role = await strapi.db
|
||||||
.query('plugin::users-permissions.role')
|
.query('plugin::users-permissions.role')
|
||||||
|
@ -91,7 +91,7 @@ describe('user-permissions auth', () => {
|
|||||||
},
|
},
|
||||||
send: jest.fn(),
|
send: jest.fn(),
|
||||||
};
|
};
|
||||||
const authorization = auth({ strapi: global.strapi })
|
const authorization = auth({ strapi: global.strapi });
|
||||||
await authorization.register(ctx);
|
await authorization.register(ctx);
|
||||||
expect(ctx.send).toHaveBeenCalledTimes(1);
|
expect(ctx.send).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@ -124,7 +124,7 @@ describe('user-permissions auth', () => {
|
|||||||
},
|
},
|
||||||
send: jest.fn(),
|
send: jest.fn(),
|
||||||
};
|
};
|
||||||
const authorization = auth({ strapi: global.strapi })
|
const authorization = auth({ strapi: global.strapi });
|
||||||
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
|
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
|
||||||
expect(ctx.send).toHaveBeenCalledTimes(0);
|
expect(ctx.send).toHaveBeenCalledTimes(0);
|
||||||
});
|
});
|
||||||
@ -157,7 +157,7 @@ describe('user-permissions auth', () => {
|
|||||||
},
|
},
|
||||||
send: jest.fn(),
|
send: jest.fn(),
|
||||||
};
|
};
|
||||||
const authorization = auth({ strapi: global.strapi })
|
const authorization = auth({ strapi: global.strapi });
|
||||||
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
|
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
|
||||||
expect(ctx.send).toHaveBeenCalledTimes(0);
|
expect(ctx.send).toHaveBeenCalledTimes(0);
|
||||||
});
|
});
|
||||||
@ -190,7 +190,7 @@ describe('user-permissions auth', () => {
|
|||||||
},
|
},
|
||||||
send: jest.fn(),
|
send: jest.fn(),
|
||||||
};
|
};
|
||||||
const authorization = auth({ strapi: global.strapi })
|
const authorization = auth({ strapi: global.strapi });
|
||||||
await authorization.register(ctx);
|
await authorization.register(ctx);
|
||||||
expect(ctx.send).toHaveBeenCalledTimes(1);
|
expect(ctx.send).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@ -222,7 +222,7 @@ describe('user-permissions auth', () => {
|
|||||||
},
|
},
|
||||||
send: jest.fn(),
|
send: jest.fn(),
|
||||||
};
|
};
|
||||||
const authorization = auth({ strapi: global.strapi })
|
const authorization = auth({ strapi: global.strapi });
|
||||||
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
|
await expect(authorization.register(ctx)).rejects.toThrow(errors.ValidationError);
|
||||||
expect(ctx.send).toHaveBeenCalledTimes(0);
|
expect(ctx.send).toHaveBeenCalledTimes(0);
|
||||||
});
|
});
|
||||||
@ -232,12 +232,12 @@ describe('user-permissions auth', () => {
|
|||||||
...mockStrapi,
|
...mockStrapi,
|
||||||
config: {
|
config: {
|
||||||
get: jest.fn((path) => {
|
get: jest.fn((path) => {
|
||||||
if (path === 'plugin::users-permissions.validationRules'){
|
if (path === 'plugin::users-permissions.validationRules') {
|
||||||
return {
|
return {
|
||||||
password:{
|
password: {
|
||||||
min:1,
|
min: 1,
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
register: {
|
register: {
|
||||||
@ -261,8 +261,8 @@ describe('user-permissions auth', () => {
|
|||||||
},
|
},
|
||||||
send: jest.fn(),
|
send: jest.fn(),
|
||||||
};
|
};
|
||||||
const authorization = auth({ strapi: global.strapi })
|
const authorization = auth({ strapi: global.strapi });
|
||||||
await authorization.register(ctx)
|
await authorization.register(ctx);
|
||||||
expect(ctx.send).toHaveBeenCalledTimes(1);
|
expect(ctx.send).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user