chore(plugin-i18n): Adapted tests to ESM
This commit is contained in:
parent
e40a05efb7
commit
8af23b9b94
3 changed files with 8 additions and 7 deletions
|
@ -1,18 +1,17 @@
|
|||
import chai from 'chai'
|
||||
import freesewing from '@freesewing/core'
|
||||
import plugin from '../dist/index.mjs'
|
||||
import i18n from '@freesewing/i18n'
|
||||
const strings = i18n.strings
|
||||
import i18n from '../../../packages/i18n/dist/en/index.mjs'
|
||||
|
||||
const expect = chai.expect
|
||||
|
||||
describe('I18n Plugin Tests', () => {
|
||||
it('Should translate text on insert', () => {
|
||||
const pattern = new freesewing.Pattern().use(plugin, { strings })
|
||||
const pattern = new freesewing.Pattern().use(plugin, { strings: { en: i18n.plugin } })
|
||||
pattern.parts.test = new pattern.Part()
|
||||
pattern.parts.test.points.anchor = new pattern.Point(-12, -34).attr(
|
||||
'data-text',
|
||||
'plugin.cutTwoStripsToFinishTheArmholes'
|
||||
'cutTwoStripsToFinishTheArmholes'
|
||||
)
|
||||
const svg = pattern.draft().render()
|
||||
expect(svg).to.contain('Cut two strips to finish the armholes')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue