Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(FlowCanvas): correct test for node selection behavior

Steven Enamakel1dc32ca609b2
diff --git a/app/src/components/flows/canvas/__tests__/FlowCanvas.test.tsx b/app/src/components/flows/canvas/__tests__/FlowCanvas.test.tsx
index ed186a257f..032937f0f2 100644
--- a/app/src/components/flows/canvas/__tests__/FlowCanvas.test.tsx
+++ b/app/src/components/flows/canvas/__tests__/FlowCanvas.test.tsx
@@ -88,10 +88,13 @@ describe('FlowCanvas', () => {
expect(screen.queryByText('main')).not.toBeInTheDocument();
});
- it('renders the minimap and zoom/pan controls', () => {
+ it('renders the minimap, custom toolbar, and background', () => {
+ // The stock `<Controls>` chrome was replaced by `CanvasToolbar` (undo/redo
+ // + zoom/fit), so this now asserts the toolbar's own testid instead of
+ // `.react-flow__controls`.
const { container } = render(<FlowCanvas nodes={sampleNodes()} edges={sampleEdges()} />);
expect(container.querySelector('.react-flow__minimap')).not.toBeNull();
- expect(container.querySelector('.react-flow__controls')).not.toBeNull();
+ expect(screen.getByTestId('flow-canvas-toolbar')).toBeInTheDocument();
expect(container.querySelector('.react-flow__background')).not.toBeNull();
});