Hold /privacy behind a flag until counsel reads it, and fix leftover legal and email copy.

This commit is contained in:
adilallo committed 2026-11-20 15:36:06 -07:00
1 parent ead6c8f716
commit 072e5362f5
43 files changed
+548 -191

No files matched your search

+11 -1
View File
@@ -118,7 +118,7 @@ describe("Footer (behavioral tests)", () => {
});
it("renders legal links to privacy and terms pages", () => {
render(<Footer />);
render(<Footer privacyEnabled />);
expect(
screen.getAllByRole("link", { name: "Privacy Policy" })[0],
).toHaveAttribute("href", "/privacy");
@@ -129,4 +129,14 @@ describe("Footer (behavioral tests)", () => {
screen.queryByRole("link", { name: "Cookies Settings" }),
).not.toBeInTheDocument();
});
it("omits the privacy link when the policy is off", () => {
render(<Footer privacyEnabled={false} />);
expect(
screen.queryByRole("link", { name: "Privacy Policy" }),
).not.toBeInTheDocument();
expect(
screen.getAllByRole("link", { name: "Terms of Service" })[0],
).toHaveAttribute("href", "/terms");
});
});
+15 -1
View File
@@ -78,7 +78,11 @@ describe("LoginForm", () => {
});
it("links terms and privacy to the legal pages", () => {
renderLoginForm();
renderWithProviders(
<Suspense fallback={null}>
<LoginForm privacyEnabled />
</Suspense>,
);
expect(
screen.getByRole("link", { name: "Terms of Service" }),
).toHaveAttribute("href", "/terms");
@@ -87,6 +91,16 @@ describe("LoginForm", () => {
).toHaveAttribute("href", "/privacy");
});
it("links terms only when the privacy policy is off", () => {
renderLoginForm();
expect(
screen.getByRole("link", { name: "Terms of Service" }),
).toHaveAttribute("href", "/terms");
expect(
screen.queryByRole("link", { name: "Privacy Policy" }),
).not.toBeInTheDocument();
});
it("shows validation error when email is invalid", async () => {
const user = userEvent.setup();
renderLoginForm();