blob: f921037d74441d915f82ae903dcc16b56eee84a6 (
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.find(TerminalSyncStatus).exists()).toBe(true);
});
});
describe('without terminal sync module', () => {
it('does not render terminal sync status', () => {
expect(wrapper.find(TerminalSyncStatus).exists()).toBe(false);
});
});
});
|