1
0
Fork 0
freesewing/packages/plugin-buttons/tests/plugin.test.mjs

18 lines
487 B
JavaScript
Raw Normal View History

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)
})
}
})