e2e: count fused Model Information names in the user homepage spec
The Protoss model cards render as .mi-name inside one full-width panel; the panel-name census now counts both render styles, keeping services.json the single source of truth.
This commit is contained in:
1 parent
203b0be145
commit
3c5d77d1fa
1 file changed
+7
-3
@@ -12,11 +12,15 @@ test("user homepage renders only user-category services", async ({ page }) => {
|
|||||||
const userNames = registry.filter((s) => s.category === "user").map((s) => s.name);
|
const userNames = registry.filter((s) => s.category === "user").map((s) => s.name);
|
||||||
|
|
||||||
// Panels hydrate client-side; poll the count, then compare exact sets.
|
// Panels hydrate client-side; poll the count, then compare exact sets.
|
||||||
|
// The three Protoss model cards are fused into one Model Information
|
||||||
|
// component: each model renders a `.mi-name` inside a full-width panel,
|
||||||
|
// not a standalone `.panel .name`. Count both render styles so the
|
||||||
|
// registry stays the single source of truth for the expected names.
|
||||||
|
const nameSel = "#grid .panel .name, #grid .mi-name";
|
||||||
await expect
|
await expect
|
||||||
.poll(() => page.locator("#grid .panel .name").count(), { timeout: 60_000 })
|
.poll(() => page.locator(nameSel).count(), { timeout: 60_000 })
|
||||||
.toBe(userNames.length);
|
.toBe(userNames.length);
|
||||||
const names = await page.locator("#grid .panel .name").allTextContents();
|
const names = await page.locator(nameSel).allTextContents();
|
||||||
|
|
||||||
expect([...names].sort()).toEqual([...userNames].sort());
|
expect([...names].sort()).toEqual([...userNames].sort());
|
||||||
// RBAC tripwire: an admin-category panel in the user grid means the gate leaks.
|
// RBAC tripwire: an admin-category panel in the user grid means the gate leaks.
|
||||||
expect(names).not.toContain("Grafana");
|
expect(names).not.toContain("Grafana");
|
||||||
|
|||||||
Reference in new issue
Block a user