mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
# Pull Request Template ## Description Replaces darkModeMixin with the new useDarkMode composable and replaces wll usages of mixin the the composable in components and pages Fixes https://linear.app/chatwoot/issue/CW-3474/rewrite-darkmodemixin-mixin-to-a-composable ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
50 lines
1.0 KiB
JavaScript
50 lines
1.0 KiB
JavaScript
import DateSeparator from '../DateSeparator.vue';
|
|
import { createLocalVue, shallowMount } from '@vue/test-utils';
|
|
import Vuex from 'vuex';
|
|
import VueI18n from 'vue-i18n';
|
|
const localVue = createLocalVue();
|
|
import i18n from 'dashboard/i18n';
|
|
localVue.use(Vuex);
|
|
localVue.use(VueI18n);
|
|
|
|
const i18nConfig = new VueI18n({
|
|
locale: 'en',
|
|
messages: i18n,
|
|
});
|
|
|
|
describe('dateSeparator', () => {
|
|
let store = null;
|
|
let actions = null;
|
|
let modules = null;
|
|
let dateSeparator = null;
|
|
|
|
beforeEach(() => {
|
|
actions = {};
|
|
|
|
modules = {
|
|
auth: {
|
|
getters: {
|
|
'appConfig/darkMode': () => 'light',
|
|
},
|
|
},
|
|
};
|
|
store = new Vuex.Store({
|
|
actions,
|
|
modules,
|
|
});
|
|
|
|
dateSeparator = shallowMount(DateSeparator, {
|
|
store,
|
|
localVue,
|
|
propsData: { date: 'Nov 18, 2019' },
|
|
mocks: { $t: msg => msg },
|
|
i18n: i18nConfig,
|
|
});
|
|
});
|
|
|
|
it('date separator snapshot', () => {
|
|
expect(dateSeparator.vm).toBeTruthy();
|
|
expect(dateSeparator.element).toMatchSnapshot();
|
|
});
|
|
});
|