This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
app/apps/e2e/tests/portal-auth.spec.ts
groombook-engineer[bot] 74571d9f2b feat(demo): expand demo pet images and seed data with diverse breed showcase
Generated 16 diverse pet images for demo site using MiniMax image generation:
- Multiple dog breeds (Golden Retriever, Poodle, Labrador, Shih Tzu, Cocker Spaniel, Schnauzer, Maltese, Dachshund, Pomeranian)
- Professional grooming styles and poses
- Studio lighting for quality showcase

Updated seed.ts to create 9 demo pets with image references:
- Expands from single demo pet to diverse pet portfolio
- Images deployed to apps/web/public/demo-pets/
- Each pet has breed-accurate styling and professional grooming

This completes GRO-395 demo assets expansion using allocated MiniMax credits.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-02 12:15:21 +00:00

54 lines
2.0 KiB
TypeScript

import { test, expect } from "./fixtures.js";
/**
* E2E tests for client portal authentication via dev login selector.
* Verifies the fix for the "Hi, Guest" bug where client name was not displayed.
*/
test.describe("Client Portal Auth", () => {
test("portal shows client name after login via dev selector", async ({ page }) => {
// Navigate to login
await page.goto("/login");
// Select Carol Client (has 2 pets per fixtures.ts)
await page.getByText("Carol Client").click();
// Should navigate to portal home
await expect(page).toHaveURL("/");
// Heading should contain client name, NOT "Hi, Guest" or "Please sign in"
const greeting = page.locator("text=/Hi,\\s*Carol/");
await expect(greeting).toBeVisible({ timeout: 10_000 });
// Should NOT show "Hi, Guest"
await expect(page.locator("text=/Hi,\\s*Guest/")).not.toBeVisible();
// Portal dashboard should render with actual content
await expect(page.locator("nav")).toBeVisible();
// Dashboard section should be visible (Home nav item is active by default)
await expect(page.getByRole("button", { name: /Home/i })).toBeVisible();
});
test("portal does not show Please sign in after client login", async ({ page }) => {
await page.goto("/login");
await page.getByText("Carol Client").click();
await expect(page).toHaveURL("/");
// Should not show "Please sign in" message
await expect(page.locator("text=/Please sign in/i")).not.toBeVisible({ timeout: 5_000 });
});
test("different client gets correct name displayed", async ({ page }) => {
await page.goto("/login");
// Select Dave Client (has 1 pet per fixtures.ts)
await page.getByText("Dave Client").click();
await expect(page).toHaveURL("/");
// Should show Dave's name, not Carol's
const greeting = page.locator("text=/Hi,\\s*Dave/");
await expect(greeting).toBeVisible({ timeout: 10_000 });
await expect(page.locator("text=/Hi,\\s*Carol/")).not.toBeVisible();
});
});