diff --git a/src/components/canvas/canvas.tsx b/src/components/canvas/canvas.tsx index 0d6a127..527a23f 100644 --- a/src/components/canvas/canvas.tsx +++ b/src/components/canvas/canvas.tsx @@ -67,7 +67,6 @@ export const Canvas = ({ title, nodes: externalNodes, edges: externalEdges, onCo { it('Should render diagram', () => { render( - + , ); - expect(screen.getByTitle('MongoDB Diagram')).toBeInTheDocument(); + const controls = screen.getByTestId('rf__controls'); + expect(within(controls).getByRole('button', { name: /Plus/ })).toBeInTheDocument(); + expect(within(controls).getByRole('button', { name: /Minus/ })).toBeInTheDocument(); + expect(within(controls).getByRole('button', { name: /Full Screen/ })).toBeInTheDocument(); + expect(screen.getByTestId('rf__minimap')).toBeInTheDocument(); + expect(screen.getByTestId('rf__node-employees')).toBeInTheDocument(); }); }); diff --git a/src/components/node/node.tsx b/src/components/node/node.tsx index 6e3c59c..ae76143 100644 --- a/src/components/node/node.tsx +++ b/src/components/node/node.tsx @@ -78,7 +78,7 @@ const NodeHeaderTitle = styled.div` ${ellipsisTruncation} `; -const NodeHandle = styled(Handle)<{ zIndex?: number }>` +const NodeHandle = styled(Handle)<{ ['z-index']?: number }>` width: 100%; height: 100%; position: absolute; @@ -87,7 +87,7 @@ const NodeHandle = styled(Handle)<{ zIndex?: number }>` border-radius: 0; transform: none; opacity: 0; - z-index: ${props => props.zIndex}; + z-index: ${props => props['z-index']}; `; export const Node = ({ @@ -139,21 +139,21 @@ export const Node = ({ }; return ( -
+