diff --git a/frontend/e2e/affected-routes.unit.test.ts b/frontend/e2e/affected-routes.unit.test.ts index 217a94cd..53e73d66 100644 --- a/frontend/e2e/affected-routes.unit.test.ts +++ b/frontend/e2e/affected-routes.unit.test.ts @@ -5,7 +5,10 @@ import type { RouteSource } from './affected-routes.ts'; import { affectedRoutes } from './affected-routes.ts'; const MANIFEST: RouteSource[] = [ - { path: '/flows', sources: ['src/pages/flows', 'src/features/flows', 'src/providers/flows-provider.tsx'] }, + { + path: '/flows', + sources: ['src/pages/flows/flows.tsx', 'src/features/flows', 'src/providers/flows-provider.tsx'], + }, { path: '/templates', sources: ['src/pages/templates', 'src/providers/templates-provider.tsx'] }, { path: '/settings/api-tokens', sources: ['src/pages/settings/settings-api-tokens.tsx'] }, ]; @@ -23,6 +26,12 @@ describe('affectedRoutes', () => { expect(result.map((route) => route.path)).toEqual(['/settings/api-tokens']); }); + it('falls back to every route for a page no manifest route renders', () => { + const result = affectedRoutes(['frontend/src/pages/flows/flow-report.tsx'], MANIFEST); + + expect(result).toHaveLength(MANIFEST.length); + }); + it('returns every route when shared infra changes', () => { const result = affectedRoutes(['frontend/src/lib/apollo.ts'], MANIFEST); @@ -43,7 +52,7 @@ describe('affectedRoutes', () => { it('collapses multiple changes in one route to a single entry', () => { const result = affectedRoutes( - ['frontend/src/pages/flows/flow.tsx', 'frontend/src/features/flows/flow-form.tsx'], + ['frontend/src/pages/flows/flows.tsx', 'frontend/src/features/flows/flow-form.tsx'], MANIFEST, ); diff --git a/frontend/e2e/routes.ts b/frontend/e2e/routes.ts index 1209e6a4..dcccbb10 100644 --- a/frontend/e2e/routes.ts +++ b/frontend/e2e/routes.ts @@ -42,7 +42,9 @@ export const ROUTE_MANIFEST: RouteManifestEntry[] = [ cassette: flowsCassette, path: routes.flows, ready: (page) => page.getByRole('row', { name: /E2E Alpha/ }), - sources: ['src/pages/flows', 'src/features/flows', 'src/providers/flows-provider.tsx'], + // Per file, not the whole dir: the report and create pages sit beside these, and claiming + // the dir would scope their diffs to routes that never render them. + sources: ['src/pages/flows/flows.tsx', 'src/features/flows', 'src/providers/flows-provider.tsx'], }, { // Message metadata (date + ID) renders at 50% opacity by design; revisit @@ -65,7 +67,7 @@ export const ROUTE_MANIFEST: RouteManifestEntry[] = [ // capturing before it exists compares live pixels against a masked baseline. ready: (page) => page.locator('.xterm').first(), sources: [ - 'src/pages/flows', + 'src/pages/flows/flow.tsx', 'src/features/flows', 'src/providers/flow-provider.tsx', 'src/providers/flows-provider.tsx',