WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto

test(web): add negative assertions to admin landing page permission tests

Add missing negative assertions to ensure single-permission tests verify
that unrelated cards are not shown. The Themes card test now asserts that
members/structure/modlog links are absent; the manageCategories, moderatePosts,
banUsers, and lockTopics tests now assert that the themes link is absent.

+7
+7
apps/web/src/routes/__tests__/admin.test.tsx
··· 114 114 expect(html).not.toContain('href="/admin/members"'); 115 115 expect(html).toContain('href="/admin/structure"'); 116 116 expect(html).not.toContain('href="/admin/modlog"'); 117 + expect(html).not.toContain('href="/admin/themes"'); 117 118 }); 118 119 119 120 it("shows only Mod Log card for user with only moderatePosts", async () => { ··· 127 128 expect(html).not.toContain('href="/admin/members"'); 128 129 expect(html).not.toContain('href="/admin/structure"'); 129 130 expect(html).toContain('href="/admin/modlog"'); 131 + expect(html).not.toContain('href="/admin/themes"'); 130 132 }); 131 133 132 134 it("shows only Mod Log card for user with only banUsers", async () => { ··· 140 142 expect(html).not.toContain('href="/admin/members"'); 141 143 expect(html).not.toContain('href="/admin/structure"'); 142 144 expect(html).toContain('href="/admin/modlog"'); 145 + expect(html).not.toContain('href="/admin/themes"'); 143 146 }); 144 147 145 148 it("shows only Mod Log card for user with only lockTopics", async () => { ··· 153 156 expect(html).not.toContain('href="/admin/members"'); 154 157 expect(html).not.toContain('href="/admin/structure"'); 155 158 expect(html).toContain('href="/admin/modlog"'); 159 + expect(html).not.toContain('href="/admin/themes"'); 156 160 }); 157 161 158 162 it("shows Themes card for user with manageThemes permission", async () => { ··· 165 169 const html = await res.text(); 166 170 expect(html).toContain('href="/admin/themes"'); 167 171 expect(html).toContain("🎨"); 172 + expect(html).not.toContain('href="/admin/members"'); 173 + expect(html).not.toContain('href="/admin/structure"'); 174 + expect(html).not.toContain('href="/admin/modlog"'); 168 175 }); 169 176 170 177 it("does not show Themes card for user with only manageMembers permission", async () => {