From 04cc821bd6cb72747f5ed623f2fddadd79f7ed86 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Wed, 22 Jul 2026 14:06:09 +0700 Subject: [PATCH] test(e2e): stop the flows entries owning pages no route renders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both flow entries claimed the whole src/pages/flows dir, which also holds the report and create pages. A diff touching only the report page scoped the run to two routes that cannot render it — the same ownership class already fixed elsewhere in the manifest. Each entry now names its own page file, so those two pages fall through to the conservative full run and the detail/list diffs scope more precisely than before. Co-Authored-By: Claude Opus 4.8 --- frontend/e2e/affected-routes.unit.test.ts | 13 +++++++++++-- frontend/e2e/routes.ts | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) 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',