From 9716e166df7c0d437e363636d762b0c1a20638d3 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 18 Feb 2018 15:52:26 -0500 Subject: [PATCH] Adding test for Path#closePath --- src/components/SVG/path.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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 + }); });