test(ui): F8-04b mobile-safe assertion for free-tier private-games entry
The desktop submenu (.desktop-only) is CSS-hidden on mobile viewports — the mobile sidebar tucks the same sub-panel entries behind a dropdown popover. Assert `toBeAttached()` instead of `toBeVisible()` so the dev-bundle smoke check works on every viewport. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -174,16 +174,16 @@ test.describe("F8-04b — tier gate", () => {
|
|||||||
// absent. The dev bundle keeps it via VITE_GALAXY_DEV_AFFORDANCES;
|
// absent. The dev bundle keeps it via VITE_GALAXY_DEV_AFFORDANCES;
|
||||||
// this assertion documents the dev-bundle behaviour and acts as
|
// this assertion documents the dev-bundle behaviour and acts as
|
||||||
// a smoke test that the runtime predicate at least evaluates
|
// a smoke test that the runtime predicate at least evaluates
|
||||||
// account.entitlement.is_paid without throwing.
|
// account.entitlement.is_paid without throwing. Use `attached`
|
||||||
|
// instead of `visible` because the desktop submenu button is
|
||||||
|
// CSS-hidden on the mobile viewports — the mobile sidebar
|
||||||
|
// tucks the same entry behind a dropdown popover.
|
||||||
const privateGamesEntry = page.getByTestId("lobby-nav-games-private-games");
|
const privateGamesEntry = page.getByTestId("lobby-nav-games-private-games");
|
||||||
// In dev DEV_AFFORDANCES=true → entry is visible (the gate is
|
await expect(privateGamesEntry).toBeAttached();
|
||||||
// bypassed for owner testing). The assertion captures that.
|
|
||||||
await expect(privateGamesEntry).toBeVisible();
|
|
||||||
|
|
||||||
// Free-tier callers reach the create form via the DEV-visible
|
// Free-tier callers reach the create form via the DEV-visible
|
||||||
// entry, but the backend still rejects the POST. Use the dev
|
// entry, but the backend still rejects the POST. Use the dev
|
||||||
// nav surface so the assertion works on mobile too (the mobile
|
// nav surface so the assertion works on mobile too.
|
||||||
// sidebar tucks the private-games entry behind a dropdown).
|
|
||||||
await page.evaluate(() => window.__galaxyNav!.go("games-private-games"));
|
await page.evaluate(() => window.__galaxyNav!.go("games-private-games"));
|
||||||
await page.getByTestId("lobby-create-button").click();
|
await page.getByTestId("lobby-create-button").click();
|
||||||
await expect(page.getByTestId("lobby-create-form")).toBeVisible();
|
await expect(page.getByTestId("lobby-create-form")).toBeVisible();
|
||||||
|
|||||||
Reference in New Issue
Block a user