2017-03-18 17:33:08 +00:00
|
|
|
import i18n from 'client/libs/i18n';
|
2017-01-15 19:08:36 +00:00
|
|
|
import commoni18n from 'common/script/i18n';
|
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
|
|
describe('i18n plugin', () => {
|
|
|
|
|
before(() => {
|
2017-08-22 16:26:53 +00:00
|
|
|
Vue.use(i18n, {
|
|
|
|
|
i18nData: {
|
|
|
|
|
strings: {
|
|
|
|
|
reportBug: 'Report a Bug',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|
2017-01-15 19:08:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('adds $t to Vue.prototype', () => {
|
|
|
|
|
expect(Vue.prototype.$t).to.be.a.function;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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');
|
|
|
|
|
});
|
|
|
|
|
});
|