2019-10-09 18:08:36 +00:00
|
|
|
import Vue from 'vue';
|
2019-10-03 15:40:38 +00:00
|
|
|
import i18n from '@/libs/i18n';
|
|
|
|
|
import commoni18n from '@/../../common/script/i18n';
|
2017-01-15 19:08:36 +00:00
|
|
|
|
|
|
|
|
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', () => {
|
2018-02-19 18:38:20 +00:00
|
|
|
expect(Vue.prototype.$t).to.exist;
|
2017-01-15 19:08:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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');
|
|
|
|
|
});
|
2019-10-09 18:08:36 +00:00
|
|
|
});
|