mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
25 lines
577 B
JavaScript
25 lines
577 B
JavaScript
import i18n from 'client/libs/i18n';
|
|
import commoni18n from 'common/script/i18n';
|
|
import Vue from 'vue';
|
|
|
|
describe('i18n plugin', () => {
|
|
before(() => {
|
|
Vue.use(i18n, {
|
|
i18nData: {
|
|
strings: {
|
|
reportBug: 'Report a Bug',
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
it('adds $t to Vue.prototype', () => {
|
|
expect(Vue.prototype.$t).to.exist;
|
|
});
|
|
|
|
it('$t is a proxy for common/i18n.t', () => {
|
|
const result = (new Vue()).$t('reportBug');
|
|
expect(result).to.equal(commoni18n.t('reportBug'));
|
|
expect(result).to.equal('Report a Bug');
|
|
});
|
|
}); |