Files
zitadel/apps/login/cypress/integration/verify.cy.ts

20 lines
715 B
TypeScript
Raw Normal View History

2023-07-05 19:06:21 +02:00
import { stub } from "../support/mock";
2023-06-15 22:42:13 +02:00
describe("/verify", () => {
it("redirects after successful email verification", () => {
2024-08-06 09:34:45 +02:00
stub("zitadel.user.v2.UserService", "VerifyEmail");
cy.visit("/verify?userId=123&code=abc&submit=true");
2023-07-03 18:36:46 +02:00
cy.location("pathname", { timeout: 10_000 }).should("eq", "/loginname");
2023-06-15 22:42:13 +02:00
});
it("shows an error if validation failed", () => {
2024-08-06 09:34:45 +02:00
stub("zitadel.user.v2.UserService", "VerifyEmail", {
2023-06-15 22:42:13 +02:00
code: 3,
error: "error validating code",
});
// TODO: Avoid uncaught exception in application
cy.once("uncaught:exception", () => false);
cy.visit("/verify?userId=123&code=abc&submit=true");
2024-09-04 14:57:02 +02:00
cy.contains("The provided code is invalid.");
2023-06-15 22:42:13 +02:00
});
});