diff --git a/e2e/collection.spec.ts b/e2e/collection.spec.ts index 831275a..7a2abb2 100644 --- a/e2e/collection.spec.ts +++ b/e2e/collection.spec.ts @@ -74,11 +74,12 @@ test.describe("Collection page", () => { await expect(page.getByText("New Backpack")).toBeVisible(); }); - test("navigates to setups tab", async ({ page }) => { + // Post-Phase-27: ?tab=setups no longer exists in Collection — falls back to gear tab + test("setups tab URL falls back to gear tab", async ({ page }) => { await page.goto("/collection?tab=setups"); await page.waitForLoadState("networkidle"); - // Setups tab shows the seeded setup - await expect(page.getByText("Weekend Overnighter")).toBeVisible(); + // Setups tab no longer exists in Collection, should fall back to gear + await expect(page.getByText("Zpacks Duplex")).toBeVisible(); }); test("gear tab is default and shows items", async ({ page }) => { @@ -87,3 +88,12 @@ test.describe("Collection page", () => { }); }); }); + +// Post-Phase-27: Setups is now a standalone top-level route +test.describe("Setups page", () => { + test("navigates to /setups and shows seeded setup", async ({ page }) => { + await page.goto("/setups"); + await page.waitForLoadState("networkidle"); + await expect(page.getByText("Weekend Overnighter")).toBeVisible(); + }); +}); diff --git a/e2e/dashboard.spec.ts b/e2e/dashboard.spec.ts index ef51ee1..ecb108e 100644 --- a/e2e/dashboard.spec.ts +++ b/e2e/dashboard.spec.ts @@ -6,50 +6,87 @@ test.describe("Dashboard", () => { await page.waitForLoadState("networkidle"); }); + // GearBox text is now the logo text in the top nav bar (not a standalone heading) test("shows GearBox heading", async ({ page }) => { await expect(page.getByText("GearBox")).toBeVisible(); }); - test("shows collection card with item count of 6", async ({ page }) => { - // The Collection card link contains "Items" label and value "6" - const collectionCard = page - .getByRole("link", { name: /collection/i }) - .first(); - await expect(collectionCard).toBeVisible(); - await expect(collectionCard.getByText("6")).toBeVisible(); - }); - - test("shows Collection, Planning, and Setups card headings", async ({ - page, - }) => { + // Post-Phase-27: landing page starts directly with discovery sections (no hero cards) + test("shows discovery section headings", async ({ page }) => { + // Hero card headings (Collection, Planning, Setups) are removed. + // Landing page now shows discovery content sections instead. await expect( - page.getByRole("heading", { name: "Collection" }), + page.getByRole("heading", { name: "Popular Setups" }), + ).toBeVisible(); + await expect( + page.getByRole("heading", { name: "Recently Added" }), + ).toBeVisible(); + await expect( + page.getByRole("heading", { name: "Trending Categories" }), ).toBeVisible(); - await expect(page.getByRole("heading", { name: "Planning" })).toBeVisible(); - await expect(page.getByRole("heading", { name: "Setups" })).toBeVisible(); }); - test("Collection card links to /collection", async ({ page }) => { - const collectionLink = page - .getByRole("link", { name: /collection/i }) - .first(); + // Post-Phase-27: Collection is now a persistent top nav link, not a dashboard card + test("top nav contains Collection link", async ({ page }) => { + const nav = page.locator("nav"); + const collectionLink = nav.getByRole("link", { name: /collection/i }); + await expect(collectionLink).toBeVisible(); await collectionLink.click(); await page.waitForLoadState("networkidle"); await expect(page).toHaveURL(/\/collection/); }); - test("shows active thread count on Planning card", async ({ page }) => { - // The Planning card is a link containing "Active threads" + // Post-Phase-27: TopNav contains Home, Collection, and Setups links + test("shows top nav with navigation links", async ({ page }) => { + const nav = page.locator("nav"); + await expect(nav).toBeVisible(); + await expect(nav.getByText("Home")).toBeVisible(); + await expect(nav.getByText("Collection")).toBeVisible(); + await expect(nav.getByText("Setups")).toBeVisible(); + }); + + // Post-Phase-27: mobile bottom tab bar with 4 items + test("shows bottom tab bar on mobile viewport", async ({ page }) => { + await page.setViewportSize({ width: 375, height: 667 }); + await page.goto("/"); + await page.waitForLoadState("networkidle"); + // Bottom tab bar should be visible with 4 items + await expect(page.getByText("Home")).toBeVisible(); + await expect(page.getByText("Collection")).toBeVisible(); + await expect(page.getByText("Setups")).toBeVisible(); + await expect(page.getByText("Search")).toBeVisible(); + }); + + // The old "collection card with item count of 6" test referenced a dashboard card + // that no longer exists post-Phase-27. Mark as fixme until discovery feed is seeded. + test.fixme( + "shows collection card with item count of 6", + async ({ page }) => { + // NOTE: The old Collection dashboard card is removed. The landing page now + // shows discovery sections (Popular Setups, Recently Added, etc.). + // This test needs to be replaced with a discovery-feed-aware assertion. + const collectionCard = page + .getByRole("link", { name: /collection/i }) + .first(); + await expect(collectionCard).toBeVisible(); + await expect(collectionCard.getByText("6")).toBeVisible(); + }, + ); + + // Planning card removed from dashboard — threads are accessed via Collection > Planning tab + test.fixme("shows active thread count on Planning card", async ({ page }) => { + // NOTE: The Planning dashboard card is removed in Phase 27. + // Planning is now accessed via Collection page > Planning tab. const planningCard = page.getByRole("link", { name: /planning/i }); await expect(planningCard.getByText("Active threads")).toBeVisible(); - // Seed has 1 active thread await expect(planningCard.getByText("1")).toBeVisible(); }); - test("shows setup count on Setups card", async ({ page }) => { - // The Setups card has a heading "Setups" + // Setups card removed from dashboard — Setups now has its own top-level /setups route + test.fixme("shows setup count on Setups card", async ({ page }) => { + // NOTE: The Setups dashboard card is removed in Phase 27. + // Setups is now a top-level route accessible via the top nav. await expect(page.getByRole("heading", { name: "Setups" })).toBeVisible(); - // Seed has 1 setup const setupsCard = page.getByRole("link", { name: /setups/i }).last(); await expect(setupsCard.getByText("1")).toBeVisible(); });