Keep listed published rules public and guest-claim rules unlisted, with semantic document markup and share chrome that stays clickable.
Guest publishes remain share-by-link but stay out of the catalog and sitemap, and their pages send noindex until claimed. The published-rule view now uses heading and list markup matching Markdown export, and top banners sit below the header so Share is not covered. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
77b0ec8ad8
commit
1445cb7e1e
27 files changed
+524
-86
No files matched your search
@@ -72,4 +72,41 @@ describe("CommunityRule", () => {
|
||||
expect(screen.getByText("Quorum")).toBeInTheDocument();
|
||||
expect(screen.getByText("60%")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("exposes category, entry, and block labels as headings and entries as a list", () => {
|
||||
render(
|
||||
<CommunityRule
|
||||
sections={[
|
||||
{
|
||||
categoryName: "Membership",
|
||||
entries: [
|
||||
{
|
||||
title: "Joining",
|
||||
body: "Ask existing members.",
|
||||
},
|
||||
{
|
||||
title: "Leaving",
|
||||
body: "Give two weeks notice.",
|
||||
blocks: [{ label: "Notice", body: "Written." }],
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>,
|
||||
);
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 2, name: "Membership" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 3, name: "Joining" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 3, name: "Leaving" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 4, name: "Notice" }),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getAllByRole("list").length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getAllByRole("listitem")).toHaveLength(3);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user