@@ -35,6 +35,7 @@ These modules carry the highest risk. Test in the same PR when modifying.
3535| ` src/infrastructure/api/chatflows.ts ` | All CRUD + ` generateAgentflow ` + ` getChatModels ` , FlowData serialization | ✅ Done |
3636| ` src/infrastructure/api/nodes.ts ` | ` getAllNodes ` , ` getNodeByName ` , ` getNodeIconUrl ` | ✅ Done |
3737| ` src/infrastructure/store/AgentflowContext.tsx ` | ` agentflowReducer ` (all actions), ` normalizeNodes ` , ` deleteNode() ` , ` duplicateNode() ` , ` openEditDialog() ` , ` closeEditDialog() ` , ` setNodes() ` , ` setEdges() ` , ` updateNodeData() ` , ` deleteEdge() ` , state synchronization with local setters. E2E: composite workflow (add→connect→edit→save), load→modify→save roundtrip, multi-edge from single node, rapid connect/disconnect cycles, edge deletion | ✅ Done |
38+ | ` src/infrastructure/store/ApiContext.tsx ` | ` ApiProvider ` — client creation, memoization, ` useApiContext ` error boundary | ✅ Done |
3839| ` src/useAgentflow.ts ` | ` getFlow() ` , ` toJSON() ` , ` validate() ` , ` addNode() ` , ` clear() ` , ` fitView() ` , ` getReactFlowInstance() ` , instance stability | ✅ Done |
3940| ` src/features/canvas/hooks/useFlowHandlers.ts ` | ` handleConnect ` , ` handleNodesChange ` , ` handleEdgesChange ` , ` handleAddNode ` — synchronous ` onFlowChange ` callbacks, dirty tracking, viewport resolution, change filtering | ✅ Done |
4041
@@ -46,28 +47,23 @@ Test when adding features or fixing bugs in these areas.
4647| File | Key exports to test | Status |
4748| --- | --- | --- |
4849| ` src/features/node-palette/search.ts ` | ` fuzzyScore ` , ` searchNodes ` , ` debounce ` | ✅ Done |
49- | ` src/features/canvas/hooks/useFlowNodes.ts ` | ` useFlowNodes() ` — category filtering, component whitelist, error states | ⬜ Not yet |
50- | ` src/features/canvas/hooks/useDragAndDrop.ts ` | ` useDragAndDrop() ` — JSON parse error handling, node init on drop | ⬜ Not yet |
51- | ` src/features/canvas/hooks/useNodeColors.ts ` | ` useNodeColors() ` — color calculations for selected/hover/dark mode | ⬜ Not yet |
52- | ` src/infrastructure/store/ConfigContext.tsx ` | ` ConfigProvider ` — theme detection (light/dark/system), media query listener | ⬜ Not yet |
53- | ` src/features/generator/GenerateFlowDialog.tsx ` | Dialog state machine — API call flow, error handling, progress state | ⬜ Not yet |
54- | ` src/features/node-editor/EditNodeDialog.tsx ` | Label editing — keyboard handling (Enter/Escape), node data updates | ⬜ Not yet |
50+ | ` src/features/canvas/hooks/useFlowNodes.ts ` | ` useFlowNodes() ` — category filtering, component whitelist, error states | ✅ Done |
51+ | ` src/features/canvas/hooks/useDragAndDrop.ts ` | ` useDragAndDrop() ` — JSON parse error handling, node init on drop | ✅ Done |
52+ | ` src/features/canvas/hooks/useNodeColors.ts ` | ` useNodeColors() ` — color calculations for selected/hover/dark mode | ✅ Done |
53+ | ` src/infrastructure/store/ConfigContext.tsx ` | ` ConfigProvider ` — theme detection (light/dark/system), media query listener | ✅ Done |
54+ | ` src/features/generator/GenerateFlowDialog.tsx ` | Dialog state machine — API call flow, error handling, progress state | ✅ Done |
55+ | ` src/features/node-editor/EditNodeDialog.tsx ` | Label editing — keyboard handling (Enter/Escape), node data updates | ✅ Done |
56+ | ` src/features/canvas/hooks/useOpenNodeEditor.ts ` | ` openNodeEditor() ` — node/schema lookup, inputValues initialization, early returns | ✅ Done |
5557
5658### Tier 3 — UI Components
5759
5860Mostly JSX with minimal logic. Only add tests if business logic is introduced.
5961
6062<!-- prettier-ignore -->
61- | File | When to add tests | Status |
63+ | File | Key exports to test | Status |
6264| --- | --- | --- |
63- | ` src/features/node-palette/AddNodesDrawer.tsx ` | If category grouping or drag serialization logic changes | ⬜ Not yet |
64- | ` src/features/canvas/components/NodeOutputHandles.tsx ` | Has ` getMinimumNodeHeight() ` — test if calculation logic changes | ⬜ Not yet |
65- | ` src/features/canvas/containers/AgentFlowNode.tsx ` | If warning state or color logic becomes more complex | ⬜ Not yet |
66- | ` src/features/canvas/containers/AgentFlowEdge.tsx ` | If edge deletion or interaction logic changes | ⬜ Not yet |
67- | ` src/features/canvas/containers/IterationNode.tsx ` | If resize or dimension calculation logic changes | ⬜ Not yet |
68- | ` src/atoms/NodeInputHandler.tsx ` | If input rendering or position calculation logic changes | ⬜ Not yet |
69- | ` src/features/canvas/components/ConnectionLine.tsx ` | If edge label determination logic becomes more complex | ⬜ Not yet |
70- | ` src/features/canvas/components/NodeStatusIndicator.tsx ` | If status-to-color/icon mapping expands | ⬜ Not yet |
65+ | ` src/features/canvas/components/NodeOutputHandles.tsx ` | ` getMinimumNodeHeight() ` — linear scaling, MIN_NODE_HEIGHT floor | ✅ Done |
66+ | ` src/features/canvas/components/ConnectionLine.tsx ` | Edge label visibility per node type, label content (condition index, humanInput proceed/reject), edge color from AGENTFLOW_ICONS | ✅ Done |
7167| ` src/Agentflow.tsx ` | Integration test — dark mode, ThemeProvider, CSS variables, header rendering, keyboard shortcuts (Cmd+S / Ctrl+S save), generate flow dialog, imperative ref | ✅ Done |
7268
7369Files that are pure styling or data constants (` styled.ts ` , ` nodeIcons.ts ` , ` MainCard.tsx ` , etc.) do not need dedicated tests.
@@ -133,14 +129,7 @@ The jest config uses file extensions to select the test environment:
133129- ** Jest config** : ` jest.config.js ` — two projects: ` unit ` (node env, ` .test.ts ` ) and ` components ` (custom jsdom env, ` .test.tsx ` )
134130- ** Test environment** : Component tests use custom jsdom environment (` src/__test_utils__/jest-environment-jsdom.js ` ) to handle canvas loading
135131- ** Import aliases** : ` @test-utils ` maps to ` src/__test_utils__ ` for convenient imports
136- - ** Coverage thresholds** : uniform 80% floor (` branches ` , ` functions ` , ` lines ` , ` statements ` ) enforced per-path:
137- - ` ./src/*.ts ` (root-level modules like ` useAgentflow.ts ` )
138- - ` ./src/Agentflow.tsx `
139- - ` ./src/core/ `
140- - ` ./src/features/canvas/hooks/useFlowHandlers.ts `
141- - ` ./src/features/node-palette/search.ts `
142- - ` ./src/infrastructure/api/ `
143- - ` ./src/infrastructure/store/AgentflowContext.tsx `
132+ - ** Coverage thresholds** : uniform 80% floor (` branches ` , ` functions ` , ` lines ` , ` statements ` ) — see ` coverageThreshold ` in ` jest.config.js ` for the full list
144133- ** Coverage exclusions** :
145134 - ` src/__test_utils__/** ` — test utilities
146135 - ` src/__mocks__/** ` — module mocks
0 commit comments