Show Login and Ask an organizer sent and error states.

Connect the live modals to the drawn sent, expired, invalid-email, and send-failed screens, pin the phone footer above the keyboard, and send the light login email.
This commit is contained in:
adilallo committed 2026-11-11 16:55:09 -07:00
1 parent 44010c7b73
commit 27d74e510c
29 files changed
+771 -281

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
import { describe, expect, it } from "vitest";
import { MAGIC_LINK_TTL_MINUTES } from "../../lib/privacyRetention";
import { buildMagicLinkMail } from "../../lib/server/magicLinkMail";
const VERIFY_URL =
"https://communityrule.info/api/auth/magic-link/verify?token=abc";
describe("buildMagicLinkMail", () => {
const mail = buildMagicLinkMail({
verifyUrl: VERIFY_URL,
origin: "https://communityrule.info",
});
it("uses the drawn subject, once-and-minutes line, and log in button", () => {
expect(mail.subject).toBe("Your login link for CommunityRule");
expect(mail.previewText).toBe(
`It works once, for ${MAGIC_LINK_TTL_MINUTES} minutes.`,
);
expect(mail.text).toContain("Log in to CommunityRule");
expect(mail.text).toContain(VERIFY_URL);
expect(mail.text).toContain(
`It works once, for ${MAGIC_LINK_TTL_MINUTES} minutes.`,
);
expect(mail.html).toContain("background:#000000");
expect(mail.html).toContain(">Log in</a>");
expect(mail.html).toContain(`href="${VERIFY_URL}"`);
expect(mail.html).toContain("/privacy");
expect(mail.html).toContain("/about");
});
it("does not invent a first name", () => {
expect(mail.html).not.toContain("Hi ");
expect(mail.text).not.toContain("Hi ");
});
});