Test with SA
This commit is contained in:
parent
6b6bca0fbb
commit
607bc010da
1 changed files with 7 additions and 17 deletions
|
@ -62,10 +62,6 @@ describe('Sewtogether Plugin Tests', () => {
|
||||||
const pattern = new Test()
|
const pattern = new Test()
|
||||||
pattern.draft()
|
pattern.draft()
|
||||||
var c = pattern.parts[0].test.paths.sewtogetherSewTogetherHinge
|
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('class')).to.equal('dotted note stroke-sm')
|
||||||
expect(c.attributes.get('marker-start')).to.equal('url(#sewTogetherCross)')
|
expect(c.attributes.get('marker-start')).to.equal('url(#sewTogetherCross)')
|
||||||
expect(c.ops[0].type).to.equal('move')
|
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)
|
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 = {
|
const part = {
|
||||||
name: 'test',
|
name: 'test',
|
||||||
draft: ({ Point, points, macro, part }) => {
|
draft: ({ Point, points, macro, part }) => {
|
||||||
points.from = new Point(10, 20)
|
points.from = new Point(10, 20)
|
||||||
|
points.hinge = new Point(40, 110)
|
||||||
points.to = new Point(10, 220)
|
points.to = new Point(10, 220)
|
||||||
macro('pleat', {
|
macro('sewtogether', {
|
||||||
from: points.from,
|
from: points.from,
|
||||||
|
hinge: points.hinge,
|
||||||
to: points.to,
|
to: points.to,
|
||||||
reverse: true,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return part
|
return part
|
||||||
|
@ -93,16 +90,9 @@ describe('Sewtogether Plugin Tests', () => {
|
||||||
plugins: [annotationPlugin],
|
plugins: [annotationPlugin],
|
||||||
}
|
}
|
||||||
const Test = new Design({ plugins: [annotationPlugin], parts: [part] })
|
const Test = new Design({ plugins: [annotationPlugin], parts: [part] })
|
||||||
const pattern = new Test()
|
const pattern = new Test({ sa: 10 })
|
||||||
pattern.draft()
|
pattern.draft()
|
||||||
var c = pattern.parts[0].test.paths.pleatPleatFrom
|
var c = pattern.parts[0].test.paths.sewtogetherSewTogetherHinge
|
||||||
expect(c.attributes.get('class')).to.equal('note dashed')
|
expect(round(c.ops[1].to.x)).to.equal(0)
|
||||||
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)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue