Replace the terms page CC BY-SA claim with a counsel-review notice.

Login still agrees to Terms of Service, but the page no longer says a community Rule is openly licensed, and Ask an organizer opens the inquiry dialog.
This commit is contained in:
adilallo committed 2026-11-23 10:40:16 -07:00
1 parent f795951443
commit 4b90bce006
5 files changed
+64 -55

No files matched your search

+16 -22
View File
@@ -1,5 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { renderWithProviders as render } from "../utils/test-utils";
import PrivacyPage from "../../app/(marketing)/privacy/page";
import LegalDocumentPage from "../../app/(marketing)/_components/LegalDocumentPage";
@@ -111,38 +112,31 @@ describe("legal document pages", () => {
);
});
test("terms page covers licenses and the templates API, not ranking", async () => {
test("terms page is a counsel-review notice with no licensing claim", async () => {
const user = userEvent.setup();
await renderLegalPage("terms", messages.pages.terms);
const page = messages.pages.terms;
expect(
screen.getByRole("heading", { level: 1, name: page.banner.title }),
).toBeInTheDocument();
expect(page.banner.title).toBe("Our terms are being reviewed");
expect(page.intro.join(" ")).not.toMatch(/CC BY-SA/i);
expect(page.intro.join(" ")).not.toMatch(/licensed/i);
expect(page.sections).toEqual([]);
expect(screen.queryByRole("heading", { name: "Licenses" })).not.toBeInTheDocument();
expect(
screen.getByRole("heading", { level: 2, name: "Licenses" }),
).toBeInTheDocument();
expect(
screen.getByRole("heading", { level: 2, name: "Templates API" }),
).toBeInTheDocument();
expect(
screen.queryByRole("heading", { name: "Recommendations" }),
screen.queryByRole("heading", { name: "Templates API" }),
).not.toBeInTheDocument();
expect(
screen.getByRole("link", { name: "CC BY-SA 4.0" }),
).toHaveAttribute(
"href",
"https://creativecommons.org/licenses/by-sa/4.0/",
);
screen.getByText(/every Rule starts private/),
).toBeInTheDocument();
await user.click(screen.getByRole("button", { name: "Ask an organizer" }));
expect(screen.getByRole("dialog")).toBeInTheDocument();
expect(
screen.getByRole("link", { name: "GPL-3.0 or later" }),
).toHaveAttribute("href", "https://www.gnu.org/licenses/gpl-3.0.html");
expect(screen.getByRole("link", { name: "Gitea" })).toHaveAttribute(
"href",
"https://git.medlab.host/CommunityRule/community-rule",
);
expect(
screen.getByRole("link", { name: "GET /api/templates" }),
).toHaveAttribute("href", "/api/templates");
screen.getByRole("heading", { name: "Ask an organizer" }),
).toBeInTheDocument();
});
test("cookies settings page explains there are no optional cookies", async () => {