fix(user#user.changePassword): delete useless tests (#118)

This commit is contained in:
heafalan
2019-07-12 11:00:05 +02:00
committed by badrAZ
parent 445b13ec29
commit b011e8656f
2 changed files with 11 additions and 24 deletions

View File

@@ -6,10 +6,6 @@ exports[`user .changePassword() : changes the actual user password 2`] = `[JsonR
exports[`user .changePassword() : fails trying to change the password with invalid oldPassword 1`] = `[JsonRpcError: invalid credentials]`;
exports[`user .changePassword() : fails trying to change the password without newPassword 1`] = `[JsonRpcError: invalid parameters]`;
exports[`user .changePassword() : fails trying to change the password without oldPassword 1`] = `[JsonRpcError: invalid parameters]`;
exports[`user .create() : creates a user with permission 1`] = `
Object {
"email": "wayne2@vates.fr",

View File

@@ -99,26 +99,17 @@ describe("user", () => {
).rejects.toMatchSnapshot();
});
withData(
{
"fails trying to change the password without newPassword": {
oldPassword: SIMPLE_USER.password,
},
"fails trying to change the password without oldPassword": {
newPassword: "newpwd",
},
"fails trying to change the password with invalid oldPassword": {
oldPassword: "falsepwd",
newPassword: "newpwd",
},
},
async data => {
await xo.createTempUser(SIMPLE_USER);
await testWithOtherConnection(SIMPLE_USER, xo =>
expect(xo.call("user.changePassword", data)).rejects.toMatchSnapshot()
);
}
);
it("fails trying to change the password with invalid oldPassword", async () => {
await xo.createTempUser(SIMPLE_USER);
await testWithOtherConnection(SIMPLE_USER, xo =>
expect(
xo.call("user.changePassword", {
oldPassword: "falsepwd",
newPassword: "newpwd",
})
).rejects.toMatchSnapshot()
);
});
});
describe(".getAll() :", () => {