chore: Improve unit test
This commit is contained in:
parent
307e975f60
commit
ac57054332
1 changed files with 13 additions and 2 deletions
|
@ -5,8 +5,19 @@ const chai = require('chai')
|
|||
const expect = chai.expect
|
||||
const plugin = require('../dist/index.js')
|
||||
|
||||
const pattern = new freesewing.Pattern().use(plugin)
|
||||
pattern.draft().render()
|
||||
|
||||
it('Should set the plugin name:version attribute', () => {
|
||||
const pattern = new freesewing.Pattern().use(plugin)
|
||||
pattern.draft().render()
|
||||
expect(pattern.svg.attributes.get('freesewing:plugin-buttons')).to.equal(version)
|
||||
})
|
||||
|
||||
for (const snippet of ['button', 'buttonhole', 'snap-stud', 'snap-socket']) {
|
||||
it(`Should add the ${snippet} snippet to defs`, () => {
|
||||
//const pattern = new freesewing.Pattern().use(plugin)
|
||||
//pattern.parts.test = new pattern.Part()
|
||||
//pattern.draft().render()
|
||||
expect(pattern.svg.defs.indexOf(`<g id="${snippet}">`)).to.not.equal(-1)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue