chore(plugin-buttons): Added (esm) unit tests. See #408
This commit is contained in:
parent
bc93f33709
commit
60b72021c0
5 changed files with 39 additions and 22 deletions
17
packages/plugin-buttons/tests/plugin.test.mjs
Normal file
17
packages/plugin-buttons/tests/plugin.test.mjs
Normal 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)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue