test(ui): F8-04b mobile-safe assertion for free-tier private-games entry
Tests · UI / test (push) Successful in 2m52s
Tests · Integration / integration (pull_request) Successful in 1m50s
Tests · Go / test (pull_request) Successful in 2m3s
Tests · UI / test (pull_request) Successful in 2m52s

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:
Ilia Denisov
2026-05-27 00:31:03 +02:00
parent cff7cc3859
commit f42ab87233
@@ -174,16 +174,16 @@ test.describe("F8-04b — tier gate", () => {
// absent. The dev bundle keeps it via VITE_GALAXY_DEV_AFFORDANCES;
// this assertion documents the dev-bundle behaviour and acts as
// 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");
// In dev DEV_AFFORDANCES=true → entry is visible (the gate is
// bypassed for owner testing). The assertion captures that.
await expect(privateGamesEntry).toBeVisible();
await expect(privateGamesEntry).toBeAttached();
// Free-tier callers reach the create form via the DEV-visible
// entry, but the backend still rejects the POST. Use the dev
// nav surface so the assertion works on mobile too (the mobile
// sidebar tucks the private-games entry behind a dropdown).
// nav surface so the assertion works on mobile too.
await page.evaluate(() => window.__galaxyNav!.go("games-private-games"));
await page.getByTestId("lobby-create-button").click();
await expect(page.getByTestId("lobby-create-form")).toBeVisible();