From 607bc010da75e26aea3f43b9df7be314d8d79bd8 Mon Sep 17 00:00:00 2001 From: Wouter van Wageningen Date: Fri, 10 Mar 2023 03:23:01 +0000 Subject: [PATCH] Test with SA --- .../tests/sewtogether.test.mjs | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/plugins/plugin-annotations/tests/sewtogether.test.mjs b/plugins/plugin-annotations/tests/sewtogether.test.mjs index afc7ddcc5af..8de8554f029 100644 --- a/plugins/plugin-annotations/tests/sewtogether.test.mjs +++ b/plugins/plugin-annotations/tests/sewtogether.test.mjs @@ -62,10 +62,6 @@ describe('Sewtogether Plugin Tests', () => { const pattern = new Test() pattern.draft() var c = pattern.parts[0].test.paths.sewtogetherSewTogetherHinge - console.log({ c: c }) - console.log({ p: pattern.parts[0].test.paths }) - console.log({ t: pattern.parts[0].test }) - console.log({ ps0: pattern.parts[0] }) expect(c.attributes.get('class')).to.equal('dotted note stroke-sm') expect(c.attributes.get('marker-start')).to.equal('url(#sewTogetherCross)') expect(c.ops[0].type).to.equal('move') @@ -76,16 +72,17 @@ describe('Sewtogether Plugin Tests', () => { expect(round(c.ops[1].to.y)).to.equal(120) }) - it('Should run the pleat/reverse macro', () => { + it('Should run the sewtogether/hinge (with sa) macro', () => { const part = { name: 'test', draft: ({ Point, points, macro, part }) => { points.from = new Point(10, 20) + points.hinge = new Point(40, 110) points.to = new Point(10, 220) - macro('pleat', { + macro('sewtogether', { from: points.from, + hinge: points.hinge, to: points.to, - reverse: true, }) return part @@ -93,16 +90,9 @@ describe('Sewtogether Plugin Tests', () => { plugins: [annotationPlugin], } const Test = new Design({ plugins: [annotationPlugin], parts: [part] }) - const pattern = new Test() + const pattern = new Test({ sa: 10 }) pattern.draft() - var c = pattern.parts[0].test.paths.pleatPleatFrom - expect(c.attributes.get('class')).to.equal('note dashed') - c = pattern.parts[0].test.paths.pleatPleatTo - expect(c.attributes.get('class')).to.equal('note') - c = pattern.parts[0].test.paths.pleatPleatArrow - expect(round(c.ops[0].to.x)).to.equal(18.75) - expect(round(c.ops[0].to.y)).to.equal(220) - expect(round(c.ops[1].to.x)).to.equal(18.75) - expect(round(c.ops[1].to.y)).to.equal(20) + var c = pattern.parts[0].test.paths.sewtogetherSewTogetherHinge + expect(round(c.ops[1].to.x)).to.equal(0) }) })