diff --git a/src/components/SVG/path.test.js b/src/components/SVG/path.test.js index 8f8d8d9..3cfd2a1 100644 --- a/src/components/SVG/path.test.js +++ b/src/components/SVG/path.test.js @@ -27,4 +27,13 @@ describe('Path', () => { expect(path.toString()).toEqual(str); }) )); + + test('path resetting with closePath', () => { + const path = new Path() + .moveTo({ x: 5, y: 5 }) + .lineTo({ x: 5, y: 5, relative: true }) + .closePath() + .lineTo({ x: 5, y: 5 }); + expect(path.toString()).toEqual('M5,5l5,5Z'); // Last lineTo is ignored since it goes nowhere + }); });