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()
|
||||
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)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue