mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-30 19:12:16 +00:00
# Which Problems Are Solved Integration tests were failing with Minified React error 419 caused by React 19 Suspense boundary issues during server-side rendering (SSR) to client-side rendering (CSR) transitions. # How the Problems Are Solved The fix handles infrastructure-level SSR errors gracefully while maintaining proper error detection for actual application issues. - Added Cypress error handling for React 19 SSR hydration errors that don't affect functionality # Additional Changes Enhanced Next.js configuration with React 19 compatibility optimizations: - `optimizePackageImports`: @radix-ui/react-tooltip and @heroicons/react can have large bundle sizes if not optimized. Such packages are suggested to be optimized in https://nextjs.org/docs/app/api-reference/config/next-config-js/optimizePackageImports - `poweredByHeader`: Not that important. Benefits are smaller HTTP headers, Tiny bandwidth savings, and more professional appearance due to cleaner response headers, added it as a "security best practice". # Additional Context - Replaces #10611
111 lines
3.2 KiB
TypeScript
111 lines
3.2 KiB
TypeScript
import { stub } from "../support/e2e";
|
|
|
|
describe("verify invite", () => {
|
|
beforeEach(() => {
|
|
stub("zitadel.org.v2.OrganizationService", "ListOrganizations", {
|
|
data: {
|
|
details: {
|
|
totalResult: 1,
|
|
},
|
|
result: [{ id: "256088834543534543" }],
|
|
},
|
|
});
|
|
|
|
stub("zitadel.user.v2.UserService", "ListAuthenticationMethodTypes", {
|
|
data: {
|
|
authMethodTypes: [], // user with no auth methods was invited
|
|
},
|
|
});
|
|
|
|
stub("zitadel.user.v2.UserService", "GetUserByID", {
|
|
data: {
|
|
user: {
|
|
userId: "221394658884845598",
|
|
state: 1,
|
|
username: "[email protected]",
|
|
loginNames: ["[email protected]"],
|
|
preferredLoginName: "[email protected]",
|
|
human: {
|
|
userId: "221394658884845598",
|
|
state: 1,
|
|
username: "[email protected]",
|
|
loginNames: ["[email protected]"],
|
|
preferredLoginName: "[email protected]",
|
|
profile: {
|
|
givenName: "John",
|
|
familyName: "Doe",
|
|
avatarUrl: "https://example.com/avatar.jpg",
|
|
},
|
|
email: {
|
|
email: "[email protected]",
|
|
isVerified: false,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
stub("zitadel.session.v2.SessionService", "CreateSession", {
|
|
data: {
|
|
details: {
|
|
sequence: 859,
|
|
changeDate: new Date("2024-04-04T09:40:55.577Z"),
|
|
resourceOwner: "220516472055706145",
|
|
},
|
|
sessionId: "221394658884845598",
|
|
sessionToken: "SDMc7DlYXPgwRJ-Tb5NlLqynysHjEae3csWsKzoZWLplRji0AYY3HgAkrUEBqtLCvOayLJPMd0ax4Q",
|
|
challenges: undefined,
|
|
},
|
|
});
|
|
|
|
stub("zitadel.session.v2.SessionService", "GetSession", {
|
|
data: {
|
|
session: {
|
|
id: "221394658884845598",
|
|
creationDate: new Date("2024-04-04T09:40:55.577Z"),
|
|
changeDate: new Date("2024-04-04T09:40:55.577Z"),
|
|
sequence: 859,
|
|
factors: {
|
|
user: {
|
|
id: "221394658884845598",
|
|
loginName: "[email protected]",
|
|
},
|
|
password: undefined,
|
|
webAuthN: undefined,
|
|
intent: undefined,
|
|
},
|
|
metadata: {},
|
|
},
|
|
},
|
|
});
|
|
|
|
stub("zitadel.settings.v2.SettingsService", "GetLoginSettings", {
|
|
data: {
|
|
settings: {
|
|
passkeysType: 1,
|
|
allowUsernamePassword: true,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
it("shows authenticators after successful invite verification", () => {
|
|
stub("zitadel.user.v2.UserService", "VerifyInviteCode");
|
|
|
|
cy.visit("/verify?userId=221394658884845598&code=abc&invite=true");
|
|
cy.url().should("include", Cypress.config().baseUrl + "/authenticator/set");
|
|
});
|
|
|
|
it("shows an error if invite code validation failed", () => {
|
|
stub("zitadel.user.v2.UserService", "VerifyInviteCode", {
|
|
code: 3,
|
|
error: "error validating code",
|
|
});
|
|
|
|
// TODO: Avoid uncaught exception in application
|
|
cy.once("uncaught:exception", () => false);
|
|
cy.visit("/verify?userId=221394658884845598&code=abc&invite=true");
|
|
cy.contains("Could not verify invite", { timeout: 10_000 });
|
|
});
|
|
});
|