Updating tests to cover an edge case

This commit is contained in:
Jeff Avallone 2018-02-20 20:25:06 -05:00
parent aa278fb193
commit 33a473734b
2 changed files with 64 additions and 0 deletions

View File

@ -31,4 +31,16 @@ describe('VerticalLayout', () => {
component.update(); component.update();
expect(component).toMatchSnapshot(); expect(component).toMatchSnapshot();
}); });
test('rendering with connectors (no sides)', async () => {
const component = mount(
<VerticalLayout withConnectors>
<SVGElement bbox={{ width: 100, height: 10 }}/>
<SVGElement bbox={{ width: 100, height: 10 }}/>
</VerticalLayout>
);
await component.instance().doReflow();
component.update();
expect(component).toMatchSnapshot();
});
}); });

View File

@ -69,6 +69,58 @@ exports[`VerticalLayout rendering 1`] = `
</VerticalLayout> </VerticalLayout>
`; `;
exports[`VerticalLayout rendering with connectors (no sides) 1`] = `
<VerticalLayout
spacing={10}
withConnectors={true}
>
<path
d="M0,15c15,0 10,-10 20,-10M140,15c-15,0 -10,-10 -20,-10M0,15c15,0 10,10 20,10M140,15c-15,0 -10,10 -20,10"
style={
Object {
"fillOpacity": 0,
"stroke": "#000",
"strokeWidth": "2px",
}
}
/>
<g
key=".0"
transform="translate(20 0)"
>
<SVGElement
bbox={
Object {
"height": 10,
"width": 100,
}
}
>
<text>
Mock content
</text>
</SVGElement>
</g>
<g
key=".1"
transform="translate(20 20)"
>
<SVGElement
bbox={
Object {
"height": 10,
"width": 100,
}
}
>
<text>
Mock content
</text>
</SVGElement>
</g>
</VerticalLayout>
`;
exports[`VerticalLayout rendering with connectors 1`] = ` exports[`VerticalLayout rendering with connectors 1`] = `
<VerticalLayout <VerticalLayout
spacing={10} spacing={10}