1
0
Fork 0

chore(plugin-buttons): Added (esm) unit tests. See #408

This commit is contained in:
Joost De Cock 2021-11-27 16:42:47 +01:00
parent bc93f33709
commit 60b72021c0
5 changed files with 39 additions and 22 deletions

View file

@ -0,0 +1,17 @@
import chai from 'chai'
import freesewing from '@freesewing/core'
import plugin from '../dist/index.mjs'
const expect = chai.expect
const pattern = new freesewing.Pattern().use(plugin)
pattern.draft().render()
describe('Buttons Plugin Test', () => {
for (const snippet of ['button', 'buttonhole', 'snap-stud', 'snap-socket']) {
it(`Should add the ${snippet} snippet to defs`, () => {
expect(pattern.svg.defs.indexOf(`<g id="${snippet}">`)).to.not.equal(-1)
})
}
})