Found by the manual e2e of the production build: - paste guests preview counted an array, so it read "[object Object]" and never offered Save guests; - New event and Add user errors now clear when the field is fixed; - "Send to all unsent" says when nothing was unsent; - the check-in lookup shows an error on an empty submit and carries the typed email or mobile into the walk-in form; - invitation emails sent over Pub/Sub now save their recipient's link, so the Emails page shows the recipient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
15 lines
598 B
TypeScript
15 lines
598 B
TypeScript
import { describe, it, expect, vi } from "vitest";
|
|
|
|
const mocks = vi.hoisted(() => ({ apiGet: vi.fn(), apiPost: vi.fn(), apiDelete: vi.fn() }));
|
|
vi.mock("@/app/lib/clientApi", () => mocks);
|
|
|
|
import { addGuests } from "./adminGuests";
|
|
|
|
describe("addGuests result", () => {
|
|
it("turns the API's added guest list into a count", async () => {
|
|
// The mobile-api returns the added guests themselves, not a number.
|
|
mocks.apiPost.mockResolvedValue({ added: [{ name: "A" }, { name: "B" }], rejected: [] });
|
|
expect(await addGuests("e1", [], true)).toEqual({ added: 2, rejected: [] });
|
|
});
|
|
});
|