chore(plugin-annotations): Fix cutonfold tests after changes
This commit is contained in:
parent
250ba663e2
commit
f6b5bd70f1
1 changed files with 18 additions and 13 deletions
|
@ -20,14 +20,15 @@ describe('Cutonfold Plugin Tests', () => {
|
||||||
},
|
},
|
||||||
plugins: [annotationsPlugin],
|
plugins: [annotationsPlugin],
|
||||||
}
|
}
|
||||||
const Test = new Design({ plugins: [annotationsPlugin], parts: [part] })
|
// Note that we're not loading core plugins but the local plugin
|
||||||
|
const Test = new Design({ plugins: [annotationsPlugin], parts: [part] }, true)
|
||||||
const pattern = new Test()
|
const pattern = new Test()
|
||||||
pattern.draft()
|
pattern.draft()
|
||||||
const c = pattern.parts[0].test.paths.cutonfoldCutonfold
|
const c = pattern.parts[0].test.paths.__macro_cutonfold_cutonfold_line
|
||||||
expect(c.attributes.get('class')).to.equal('note')
|
expect(c.attributes.get('class')).to.equal('note')
|
||||||
expect(c.attributes.get('marker-start')).to.equal('url(#cutonfoldFrom)')
|
expect(c.attributes.get('marker-start')).to.equal('url(#cutonfoldFrom)')
|
||||||
expect(c.attributes.get('marker-end')).to.equal('url(#cutonfoldTo)')
|
expect(c.attributes.get('marker-end')).to.equal('url(#cutonfoldTo)')
|
||||||
expect(c.attributes.get('data-text')).to.equal('cutOnFold')
|
expect(c.attributes.get('data-text')).to.equal('plugin-annotations:cutOnFold')
|
||||||
expect(c.attributes.get('data-text-class')).to.equal('center fill-note')
|
expect(c.attributes.get('data-text-class')).to.equal('center fill-note')
|
||||||
expect(c.ops[0].type).to.equal('move')
|
expect(c.ops[0].type).to.equal('move')
|
||||||
expect(c.ops[1].type).to.equal('line')
|
expect(c.ops[1].type).to.equal('line')
|
||||||
|
@ -59,11 +60,13 @@ describe('Cutonfold Plugin Tests', () => {
|
||||||
},
|
},
|
||||||
plugins: [annotationsPlugin],
|
plugins: [annotationsPlugin],
|
||||||
}
|
}
|
||||||
const Test = new Design({ plugins: [annotationsPlugin], parts: [part] })
|
// Note that we're not loading core plugins but the local plugin
|
||||||
|
const Test = new Design({ plugins: [annotationsPlugin], parts: [part] }, true)
|
||||||
const pattern = new Test()
|
const pattern = new Test()
|
||||||
pattern.draft()
|
pattern.draft()
|
||||||
const c = pattern.parts[0].test.paths.cutonfoldCutonfold
|
expect(
|
||||||
expect(c.attributes.get('data-text')).to.equal('cutOnFoldAndGrainline')
|
pattern.parts[0].test.paths.__macro_cutonfold_cutonfold_line.attributes.get('data-text')
|
||||||
|
).to.equal('plugin-annotations:cutOnFoldAndGrainline')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should run the cutonfold macro with configurable offset', () => {
|
it('Should run the cutonfold macro with configurable offset', () => {
|
||||||
|
@ -82,14 +85,15 @@ describe('Cutonfold Plugin Tests', () => {
|
||||||
},
|
},
|
||||||
plugins: [annotationsPlugin],
|
plugins: [annotationsPlugin],
|
||||||
}
|
}
|
||||||
const Test = new Design({ plugins: [annotationsPlugin], parts: [part] })
|
// Note that we're not loading core plugins but the local plugin
|
||||||
|
const Test = new Design({ plugins: [annotationsPlugin], parts: [part] }, true)
|
||||||
const pattern = new Test()
|
const pattern = new Test()
|
||||||
pattern.draft()
|
pattern.draft()
|
||||||
let c = pattern.parts[0].test.paths.cutonfoldCutonfold
|
let c = pattern.parts[0].test.paths.__macro_cutonfold_cutonfold_line
|
||||||
expect(c.attributes.get('class')).to.equal('note')
|
expect(c.attributes.get('class')).to.equal('note')
|
||||||
expect(c.attributes.get('marker-start')).to.equal('url(#cutonfoldFrom)')
|
expect(c.attributes.get('marker-start')).to.equal('url(#cutonfoldFrom)')
|
||||||
expect(c.attributes.get('marker-end')).to.equal('url(#cutonfoldTo)')
|
expect(c.attributes.get('marker-end')).to.equal('url(#cutonfoldTo)')
|
||||||
expect(c.attributes.get('data-text')).to.equal('cutOnFold')
|
expect(c.attributes.get('data-text')).to.equal('plugin-annotations:cutOnFold')
|
||||||
expect(c.attributes.get('data-text-class')).to.equal('center fill-note')
|
expect(c.attributes.get('data-text-class')).to.equal('center fill-note')
|
||||||
expect(c.ops[0].type).to.equal('move')
|
expect(c.ops[0].type).to.equal('move')
|
||||||
expect(c.ops[1].type).to.equal('line')
|
expect(c.ops[1].type).to.equal('line')
|
||||||
|
@ -114,21 +118,22 @@ describe('Cutonfold Plugin Tests', () => {
|
||||||
macro('cutonfold', {
|
macro('cutonfold', {
|
||||||
from: points.from,
|
from: points.from,
|
||||||
to: points.to,
|
to: points.to,
|
||||||
margin: 20,
|
margin: 0.2,
|
||||||
})
|
})
|
||||||
|
|
||||||
return part
|
return part
|
||||||
},
|
},
|
||||||
plugins: [annotationsPlugin],
|
plugins: [annotationsPlugin],
|
||||||
}
|
}
|
||||||
const Test = new Design({ plugins: [annotationsPlugin], parts: [part] })
|
// Note that we're not loading core plugins but the local plugin
|
||||||
|
const Test = new Design({ plugins: [annotationsPlugin], parts: [part] }, true)
|
||||||
const pattern = new Test()
|
const pattern = new Test()
|
||||||
pattern.draft()
|
pattern.draft()
|
||||||
let c = pattern.parts[0].test.paths.cutonfoldCutonfold
|
let c = pattern.parts[0].test.paths.__macro_cutonfold_cutonfold_line
|
||||||
expect(c.attributes.get('class')).to.equal('note')
|
expect(c.attributes.get('class')).to.equal('note')
|
||||||
expect(c.attributes.get('marker-start')).to.equal('url(#cutonfoldFrom)')
|
expect(c.attributes.get('marker-start')).to.equal('url(#cutonfoldFrom)')
|
||||||
expect(c.attributes.get('marker-end')).to.equal('url(#cutonfoldTo)')
|
expect(c.attributes.get('marker-end')).to.equal('url(#cutonfoldTo)')
|
||||||
expect(c.attributes.get('data-text')).to.equal('cutOnFold')
|
expect(c.attributes.get('data-text')).to.equal('plugin-annotations:cutOnFold')
|
||||||
expect(c.attributes.get('data-text-class')).to.equal('center fill-note')
|
expect(c.attributes.get('data-text-class')).to.equal('center fill-note')
|
||||||
expect(c.ops[0].type).to.equal('move')
|
expect(c.ops[0].type).to.equal('move')
|
||||||
expect(c.ops[1].type).to.equal('line')
|
expect(c.ops[1].type).to.equal('line')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue