prettier
This commit is contained in:
@ -17,9 +17,7 @@ jest.mock("preview-email", () => jest.fn());
|
||||
|
||||
describe.skip("forgotPassword mutation", () => {
|
||||
it("does not throw error if user doesn't exist", async () => {
|
||||
await expect(
|
||||
forgotPassword({ email: "no-user@email.com" }, {} as Ctx),
|
||||
).resolves.not.toThrow();
|
||||
await expect(forgotPassword({ email: "no-user@email.com" }, {} as Ctx)).resolves.not.toThrow();
|
||||
});
|
||||
|
||||
it("works correctly", async () => {
|
||||
|
@ -58,17 +58,11 @@ describe.skip("resetPassword mutation", () => {
|
||||
|
||||
// Expired token
|
||||
await expect(
|
||||
resetPassword(
|
||||
{ token: expiredToken, password: newPassword, passwordConfirmation: newPassword },
|
||||
mockCtx,
|
||||
),
|
||||
resetPassword({ token: expiredToken, password: newPassword, passwordConfirmation: newPassword }, mockCtx),
|
||||
).rejects.toThrowError();
|
||||
|
||||
// Good token
|
||||
await resetPassword(
|
||||
{ token: goodToken, password: newPassword, passwordConfirmation: newPassword },
|
||||
mockCtx,
|
||||
);
|
||||
await resetPassword({ token: goodToken, password: newPassword, passwordConfirmation: newPassword }, mockCtx);
|
||||
|
||||
// Delete's the token
|
||||
const numberOfTokens = await db.token.count({ where: { userId: user.id } });
|
||||
@ -76,8 +70,6 @@ describe.skip("resetPassword mutation", () => {
|
||||
|
||||
// Updates user's password
|
||||
const updatedUser = await db.user.findFirst({ where: { id: user.id } });
|
||||
expect(await SecurePassword.verify(updatedUser!.hashedPassword, newPassword)).toBe(
|
||||
SecurePassword.VALID,
|
||||
);
|
||||
expect(await SecurePassword.verify(updatedUser!.hashedPassword, newPassword)).toBe(SecurePassword.VALID);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user