Merge pull request #2895 from wbkd/chore/plugin-testids

Add data-testids for plugins
This commit is contained in:
Moritz Klack
2023-03-06 16:46:47 +01:00
committed by GitHub
4 changed files with 21 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
---
'@reactflow/background': patch
'@reactflow/controls': patch
'@reactflow/core': patch
'@reactflow/minimap': patch
---
add data-testid for controls, minimap and background

View File

@@ -59,6 +59,7 @@ function Background({
left: 0,
}}
ref={ref}
data-testid="rf__background"
>
<pattern
id={patternId}

View File

@@ -68,7 +68,12 @@ const Controls: FC<PropsWithChildren<ControlProps>> = ({
};
return (
<Panel className={cc(['react-flow__controls', className])} position={position} style={style}>
<Panel
className={cc(['react-flow__controls', className])}
position={position}
style={style}
data-testid="rf__controls"
>
{showZoom && (
<>
<ControlButton

View File

@@ -161,7 +161,12 @@ function MiniMap({
: undefined;
return (
<Panel position={position} style={style} className={cc(['react-flow__minimap', className])}>
<Panel
position={position}
style={style}
className={cc(['react-flow__minimap', className])}
data-testid="rf__minimap"
>
<svg
width={elementWidth}
height={elementHeight}