test(27-00): wave 0 E2E scaffolding for Phase 27 nav restructure
- Update dashboard.spec.ts: replace old card heading tests with discovery section tests - Add TopNav presence test (Home/Collection/Setups links in nav) - Add mobile bottom tab bar test with 375px viewport - Mark removed dashboard card tests as test.fixme with explanatory comments - Update collection.spec.ts: replace setups tab test with fallback-to-gear test - Add standalone /setups route test in new Setups page describe block - All tests expected to fail until Plans 01-03 implement the new UI
This commit is contained in:
@@ -74,11 +74,12 @@ test.describe("Collection page", () => {
|
|||||||
await expect(page.getByText("New Backpack")).toBeVisible();
|
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.goto("/collection?tab=setups");
|
||||||
await page.waitForLoadState("networkidle");
|
await page.waitForLoadState("networkidle");
|
||||||
// Setups tab shows the seeded setup
|
// Setups tab no longer exists in Collection, should fall back to gear
|
||||||
await expect(page.getByText("Weekend Overnighter")).toBeVisible();
|
await expect(page.getByText("Zpacks Duplex")).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("gear tab is default and shows items", async ({ page }) => {
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -6,50 +6,87 @@ test.describe("Dashboard", () => {
|
|||||||
await page.waitForLoadState("networkidle");
|
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 }) => {
|
test("shows GearBox heading", async ({ page }) => {
|
||||||
await expect(page.getByText("GearBox")).toBeVisible();
|
await expect(page.getByText("GearBox")).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("shows collection card with item count of 6", async ({ page }) => {
|
// Post-Phase-27: landing page starts directly with discovery sections (no hero cards)
|
||||||
// The Collection card link contains "Items" label and value "6"
|
test("shows discovery section headings", async ({ page }) => {
|
||||||
const collectionCard = page
|
// Hero card headings (Collection, Planning, Setups) are removed.
|
||||||
.getByRole("link", { name: /collection/i })
|
// Landing page now shows discovery content sections instead.
|
||||||
.first();
|
|
||||||
await expect(collectionCard).toBeVisible();
|
|
||||||
await expect(collectionCard.getByText("6")).toBeVisible();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("shows Collection, Planning, and Setups card headings", async ({
|
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
await expect(
|
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();
|
).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 }) => {
|
// Post-Phase-27: Collection is now a persistent top nav link, not a dashboard card
|
||||||
const collectionLink = page
|
test("top nav contains Collection link", async ({ page }) => {
|
||||||
.getByRole("link", { name: /collection/i })
|
const nav = page.locator("nav");
|
||||||
.first();
|
const collectionLink = nav.getByRole("link", { name: /collection/i });
|
||||||
|
await expect(collectionLink).toBeVisible();
|
||||||
await collectionLink.click();
|
await collectionLink.click();
|
||||||
await page.waitForLoadState("networkidle");
|
await page.waitForLoadState("networkidle");
|
||||||
await expect(page).toHaveURL(/\/collection/);
|
await expect(page).toHaveURL(/\/collection/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("shows active thread count on Planning card", async ({ page }) => {
|
// Post-Phase-27: TopNav contains Home, Collection, and Setups links
|
||||||
// The Planning card is a link containing "Active threads"
|
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 });
|
const planningCard = page.getByRole("link", { name: /planning/i });
|
||||||
await expect(planningCard.getByText("Active threads")).toBeVisible();
|
await expect(planningCard.getByText("Active threads")).toBeVisible();
|
||||||
// Seed has 1 active thread
|
|
||||||
await expect(planningCard.getByText("1")).toBeVisible();
|
await expect(planningCard.getByText("1")).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("shows setup count on Setups card", async ({ page }) => {
|
// Setups card removed from dashboard — Setups now has its own top-level /setups route
|
||||||
// The Setups card has a heading "Setups"
|
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();
|
await expect(page.getByRole("heading", { name: "Setups" })).toBeVisible();
|
||||||
// Seed has 1 setup
|
|
||||||
const setupsCard = page.getByRole("link", { name: /setups/i }).last();
|
const setupsCard = page.getByRole("link", { name: /setups/i }).last();
|
||||||
await expect(setupsCard.getByText("1")).toBeVisible();
|
await expect(setupsCard.getByText("1")).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user