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:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user