2021-11-27 16:44:13 +01:00
|
|
|
import chai from 'chai'
|
|
|
|
import freesewing from '@freesewing/core'
|
|
|
|
import plugin from '../dist/index.mjs'
|
2022-06-14 23:13:59 +02:00
|
|
|
import i18n from '@freesewing/i18n'
|
|
|
|
const strings = i18n.strings
|
2021-11-27 16:44:13 +01:00
|
|
|
|
|
|
|
const expect = chai.expect
|
|
|
|
|
|
|
|
describe('I18n Plugin Tests', () => {
|
|
|
|
it('Should translate text on insert', () => {
|
|
|
|
const pattern = new freesewing.Pattern().use(plugin, { strings })
|
|
|
|
pattern.parts.test = new pattern.Part()
|
|
|
|
pattern.parts.test.points.anchor = new pattern.Point(-12, -34).attr(
|
|
|
|
'data-text',
|
|
|
|
'plugin.cutTwoStripsToFinishTheArmholes'
|
|
|
|
)
|
|
|
|
const svg = pattern.draft().render()
|
|
|
|
expect(svg).to.contain('Cut two strips to finish the armholes')
|
|
|
|
})
|
|
|
|
})
|