mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Client: async resources, make store reusable, move plugins and add getTaskFor getter (#8575)
Add library to manage async resource Make Store reusable for easier testing Move plugin to libs Add getTaskFor getter with tests
This commit is contained in:
19
test/client/unit/specs/libs/i18n.js
Normal file
19
test/client/unit/specs/libs/i18n.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import i18n from 'client/libs/i18n';
|
||||
import commoni18n from 'common/script/i18n';
|
||||
import Vue from 'vue';
|
||||
|
||||
describe('i18n plugin', () => {
|
||||
before(() => {
|
||||
Vue.use(i18n);
|
||||
});
|
||||
|
||||
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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user