Stop treating login/save-progress as a 48-character email limit.
The overlay was failing Zod on preset method-card support text attached with the draft; raise that cap, allow RFC-length emails, and drop Back to home from the overlay. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -43,6 +43,7 @@ vi.mock("../../app/(app)/create/utils/anonymousDraftStorage", async (importOrigi
|
||||
};
|
||||
});
|
||||
|
||||
import { EMAIL_MAX_LEN } from "../../lib/create/isValidCreateFlowSaveEmail";
|
||||
import { requestMagicLink } from "../../lib/create/api";
|
||||
import { setTransferPendingFlag } from "../../app/(app)/create/utils/anonymousDraftStorage";
|
||||
|
||||
@@ -70,7 +71,7 @@ describe("LoginForm", () => {
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("textbox", { name: /email address/i }),
|
||||
).toBeInTheDocument();
|
||||
).toHaveAttribute("maxLength", String(EMAIL_MAX_LEN));
|
||||
expect(
|
||||
screen.getByRole("button", { name: /send me a magic link/i }),
|
||||
).toBeInTheDocument();
|
||||
@@ -126,6 +127,24 @@ describe("LoginForm", () => {
|
||||
expect(screen.getByText(/we sent a sign-in link/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("submits a long email without treating length as invalid", async () => {
|
||||
const user = userEvent.setup();
|
||||
const email =
|
||||
"very.long.local-part.for.testing@subdomain.example.communityrule.org";
|
||||
vi.mocked(requestMagicLink).mockResolvedValue({ ok: true });
|
||||
renderLoginForm();
|
||||
await user.type(
|
||||
screen.getByRole("textbox", { name: /email address/i }),
|
||||
email,
|
||||
);
|
||||
await user.click(
|
||||
screen.getByRole("button", { name: /send me a magic link/i }),
|
||||
);
|
||||
await waitFor(() => {
|
||||
expect(requestMagicLink).toHaveBeenCalledWith(email, "/", undefined);
|
||||
});
|
||||
});
|
||||
|
||||
it("saveProgress variant uses magicLinkNextPath and sets transfer pending on success", async () => {
|
||||
const user = userEvent.setup();
|
||||
vi.mocked(requestMagicLink).mockResolvedValue({ ok: true });
|
||||
|
||||
Reference in New Issue
Block a user