From 80eab3896b2f592a57e22c34c72807738c7a59bc Mon Sep 17 00:00:00 2001 From: Benjamin F Date: Thu, 29 Dec 2022 07:06:59 -0800 Subject: [PATCH] fix(core): Add test for Path.join() for paths with noop operations --- packages/core/tests/path.test.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/core/tests/path.test.mjs b/packages/core/tests/path.test.mjs index 7468a8c736a..ffc438d5f74 100644 --- a/packages/core/tests/path.test.mjs +++ b/packages/core/tests/path.test.mjs @@ -201,6 +201,16 @@ describe('Path', () => { expect(joint.ops.length).to.equal(4) }) + it('Should join paths that have noop operations', () => { + const line = new Path().move(new Point(0, 0)).line(new Point(0, 40)).noop('test1') + const curve = new Path() + .move(new Point(123, 456)) + .curve(new Point(0, 40), new Point(123, 34), new Point(230, 4)) + .noop('test2') + const joint = curve.join(line) + expect(joint.ops.length).to.equal(6) + }) + it('Should throw error when joining a closed paths', () => { const line = new Path().move(new Point(0, 0)).line(new Point(0, 40)) const curve = new Path()