blob: 5b1502cc190a7904e6cf07c70d496bd4c59c87bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import Vuex from 'vuex';
import TerminalSyncStatus from '~/ide/components/terminal_sync/terminal_sync_status.vue';
import TerminalSyncStatusSafe from '~/ide/components/terminal_sync/terminal_sync_status_safe.vue';
Vue.use(Vuex);
describe('ide/components/terminal_sync/terminal_sync_status_safe', () => {
let store;
let wrapper;
const createComponent = () => {
store = new Vuex.Store({
state: {},
});
wrapper = shallowMount(TerminalSyncStatusSafe, {
store,
});
};
beforeEach(createComponent);
afterEach(() => {
wrapper.destroy();
});
describe('with terminal sync module in store', () => {
beforeEach(() => {
store.registerModule('terminalSync', {
state: {},
});
});
it('renders terminal sync status', () => {
expect(wrapper.findComponent(TerminalSyncStatus).exists()).toBe(true);
});
});
describe('without terminal sync module', () => {
it('does not render terminal sync status', () => {
expect(wrapper.findComponent(TerminalSyncStatus).exists()).toBe(false);
});
});
});
|