This commit is contained in:
Max Peintner
2024-10-24 15:28:09 +02:00
parent 3b6291bcd4
commit facd27ca5a
3 changed files with 14 additions and 6 deletions

View File

@@ -5,6 +5,13 @@ describe("register", () => {
stub("zitadel.user.v2.UserService", "AddHumanUser", {
data: {
userId: "123",
email: {
email: "john@zitadel.com",
},
profile: {
givenName: "John",
familyName: "Doe",
},
},
});
});

View File

@@ -1,10 +1,10 @@
import { stub } from "../support/mock";
describe("/verify", () => {
it("shows password and passkey method after successful invite verification", () => {
it("shows authenticators after successful invite verification", () => {
stub("zitadel.user.v2.UserService", "VerifyInviteCode");
cy.visit("/verify?userId=123&code=abc&submit=true&invite=true");
cy.location("pathname", { timeout: 10_000 }).should(
cy.location("pathname", { timeout: 10000 }).should(
"eq",
"/authenticator/set",
);
@@ -17,17 +17,18 @@ describe("/verify", () => {
// TODO: Avoid uncaught exception in application
cy.once("uncaught:exception", () => false);
cy.visit("/verify?userId=123&code=abc&submit=true&invite=true");
cy.contains("Could not verify user");
cy.contains("Could not verify invite", { timeout: 10000 });
});
it("shows password and passkey method after successful invite verification", () => {
stub("zitadel.user.v2.UserService", "VerifyEmail");
cy.visit("/verify?userId=123&code=abc&submit=true");
cy.location("pathname", { timeout: 10_000 }).should(
cy.location("pathname", { timeout: 10000 }).should(
"eq",
"/authenticator/set",
);
});
it("shows an error if invite code validation failed", () => {
stub("zitadel.user.v2.UserService", "VerifyEmail", {
code: 3,
@@ -36,6 +37,6 @@ describe("/verify", () => {
// TODO: Avoid uncaught exception in application
cy.once("uncaught:exception", () => false);
cy.visit("/verify?userId=123&code=abc&submit=true");
cy.contains("Could not verify user");
cy.contains("Could not verify email", { timeout: 10000 });
});
});

View File

@@ -51,7 +51,7 @@ export function LanguageSwitcher() {
anchor="bottom"
transition
className={clsx(
"w-[var(--button-width)] rounded-xl border border-black/5 dark:border-white/5 bg-black/5 dark:bg-white/5 p-1 [--anchor-gap:var(--spacing-1)] focus:outline-none",
"w-[var(--button-width)] rounded-xl border border-black/5 dark:border-white/5 bg-background-light-500 dark:bg-background-dark-500 p-1 [--anchor-gap:var(--spacing-1)] focus:outline-none",
"transition duration-100 ease-in data-[leave]:data-[closed]:opacity-0",
)}
>