test(e2e): stop the flows entries owning pages no route renders

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 <noreply@anthropic.com>
This commit is contained in:
Sergey Kozyrenko
2026-07-22 14:06:09 +07:00
co-authored by Claude Opus 4.8
parent d58f840702
commit 04cc821bd6
2 changed files with 15 additions and 4 deletions
+11 -2
View File
@@ -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,
);
+4 -2
View File
@@ -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',