diff --git a/plugins/plugin-i18n/src/index.mjs b/plugins/plugin-i18n/src/index.mjs index 5e22226ba6d..86ed6e50f1a 100644 --- a/plugins/plugin-i18n/src/index.mjs +++ b/plugins/plugin-i18n/src/index.mjs @@ -22,4 +22,3 @@ export const plugin = { // More specifically named exports export const i18nPlugin = plugin export const pluginI18n = plugin - diff --git a/plugins/plugin-i18n/tests/plugin.test.mjs b/plugins/plugin-i18n/tests/plugin.test.mjs index ff8ce3ac322..75ce66c7339 100644 --- a/plugins/plugin-i18n/tests/plugin.test.mjs +++ b/plugins/plugin-i18n/tests/plugin.test.mjs @@ -1,26 +1,35 @@ import chai from 'chai' import { Design } from '@freesewing/core' -import { plugin } from '../dist/index.mjs' +import { plugin } from '../src/index.mjs' const expect = chai.expect const content = { strings: { en: { - testString: 'This is a test string for the i18n plugin' - } - } + testString: 'This is a test string for the i18n plugin', + }, + }, } describe('I18n Plugin Tests', () => { it('Should translate text on insert', () => { - const Pattern = new Design() - const pattern = new Pattern().use(plugin, content) - pattern.parts.test = new pattern.Part() - pattern.parts.test.points.anchor = new pattern.Point(-12, -34).attr( - 'data-text', - 'testString' - ) + const part = { + name: 'test', + draft: ({ points, Point, macro, part }) => { + points.anchor = new pattern.Point(-12, -34).attr('data-text', 'testString') + points.from = new Point(10, 20) + points.to = new Point(10, 230) + macro('grainline', { + from: points.from, + to: points.to, + }) + return part + }, + plugins: [[plugin, content]], + } + const Pattern = new Design({ parts: [part] }) + const pattern = new Pattern() const svg = pattern.draft().render() expect(svg).to.contain(content.strings.en.testString) }) diff --git a/plugins/plugin-i18n/tests/shared.test.mjs b/plugins/plugin-i18n/tests/shared.test.mjs index fdf846844b0..ea9a6b5c890 100644 --- a/plugins/plugin-i18n/tests/shared.test.mjs +++ b/plugins/plugin-i18n/tests/shared.test.mjs @@ -4,4 +4,3 @@ import { sharedPluginTests } from '../../../tests/plugins/shared.mjs' // Run shared tests sharedPluginTests(plugin) -