Implement about page
This commit is contained in:
@@ -222,4 +222,41 @@ describe("QuoteBlock Component", () => {
|
||||
screen.queryByText("The Tyranny of Structurelessness"),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("statement variant renders dual paragraphs without attribution", () => {
|
||||
render(
|
||||
<QuoteBlock
|
||||
variant="statement"
|
||||
id="about-test-quote"
|
||||
quote="First paragraph of the statement."
|
||||
quoteSecondary="Second paragraph of the statement."
|
||||
/>,
|
||||
);
|
||||
|
||||
const region = screen.getByRole("region", {
|
||||
name: /first paragraph of the statement/i,
|
||||
});
|
||||
expect(region).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText("Second paragraph of the statement."),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.queryByRole("cite")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("statement variant logs when quoteSecondary is missing", () => {
|
||||
const consoleSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
|
||||
render(
|
||||
<QuoteBlock
|
||||
variant="statement"
|
||||
quote="Only one paragraph"
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(consoleSpy).toHaveBeenCalledWith(
|
||||
"QuoteBlock: statement variant requires non-empty quote and quoteSecondary",
|
||||
);
|
||||
|
||||
consoleSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,11 +9,16 @@ vi.mock("../../lib/server/mail", () => ({
|
||||
}));
|
||||
|
||||
const rateLimitKeyMock = vi.hoisted(() =>
|
||||
vi.fn(() => ({ ok: true as const })),
|
||||
vi.fn(
|
||||
(_key: string, _minIntervalMs: number): { ok: true } | { ok: false; retryAfterMs: number } => ({
|
||||
ok: true,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
vi.mock("../../lib/server/rateLimit", () => ({
|
||||
rateLimitKey: (...args: unknown[]) => rateLimitKeyMock(...args),
|
||||
rateLimitKey: (key: string, minIntervalMs: number) =>
|
||||
rateLimitKeyMock(key, minIntervalMs),
|
||||
}));
|
||||
|
||||
import { POST } from "../../app/api/organizer-inquiry/route";
|
||||
|
||||
Reference in New Issue
Block a user