import { test, expect } from "@playwright/test"; import { openApp } from "./helpers"; // Locks channel-view entry + exit: opening a channel from a feed card replaces the view, and // both the in-page Back and the browser Back return to the feed. (This orthogonal channel branch // is exactly what the Platform refactor folds into the PageShell contract.) test.describe("channel view", () => { test("open from a card, then in-page Back returns to the feed", async ({ page }) => { await openApp(page); await expect(page.getByTestId("video-card").first()).toBeVisible(); await page.getByTestId("video-card-channel").first().click(); await expect(page.getByTestId("channel-title")).toBeVisible(); await expect(page.getByTestId("channel-back")).toBeVisible(); await page.getByTestId("channel-back").click(); await expect(page.getByTestId("channel-title")).toHaveCount(0); await expect(page.getByTestId("video-card").first()).toBeVisible(); }); test("browser Back also closes the channel page", async ({ page }) => { await openApp(page); await expect(page.getByTestId("video-card").first()).toBeVisible(); await page.getByTestId("video-card-channel").first().click(); await expect(page.getByTestId("channel-title")).toBeVisible(); await page.goBack(); await expect(page.getByTestId("channel-title")).toHaveCount(0); await expect(page.getByTestId("video-card").first()).toBeVisible(); }); });