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(appview): tighten roles URI assertion to exact DID + rkey (ATB-50) (#78)

Replace loose pattern checks (toMatch, toContain) with an exact toBe()
assertion using the seeded role's full AT URI. Also assert toHaveLength(1)
so the test fails if extra roles appear unexpectedly.

authored by

Malpercio and committed by
GitHub
f53be905 376837df

+2 -7
+2 -7
apps/appview/src/routes/__tests__/admin.test.ts
··· 472 472 473 473 expect(res.status).toBe(200); 474 474 const data = await res.json() as { roles: Array<{ name: string; uri: string; id: string }> }; 475 - expect(data.roles.length).toBeGreaterThan(0); 476 - // Every role should have a uri field 477 - for (const role of data.roles) { 478 - expect(role.uri).toBeDefined(); 479 - expect(role.uri).toMatch(/^at:\/\//); 480 - expect(role.uri).toContain("/space.atbb.forum.role/"); 481 - } 475 + expect(data.roles).toHaveLength(1); 476 + expect(data.roles[0].uri).toBe(`at://${ctx.config.forumDid}/space.atbb.forum.role/moderator`); 482 477 }); 483 478 }); 484 479