Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/ide/components/ide_status_list_spec.js')
-rw-r--r--spec/frontend/ide/components/ide_status_list_spec.js27
1 files changed, 19 insertions, 8 deletions
diff --git a/spec/frontend/ide/components/ide_status_list_spec.js b/spec/frontend/ide/components/ide_status_list_spec.js
index bb8165d1a52..02b5dc19bd8 100644
--- a/spec/frontend/ide/components/ide_status_list_spec.js
+++ b/spec/frontend/ide/components/ide_status_list_spec.js
@@ -6,17 +6,21 @@ import TerminalSyncStatusSafe from '~/ide/components/terminal_sync/terminal_sync
const TEST_FILE = {
name: 'lorem.md',
- editorRow: 3,
- editorColumn: 23,
- fileLanguage: 'markdown',
content: 'abc\nndef',
permalink: '/lorem.md',
};
+const TEST_FILE_EDITOR = {
+ fileLanguage: 'markdown',
+ editorRow: 3,
+ editorColumn: 23,
+};
+const TEST_EDITOR_POSITION = `${TEST_FILE_EDITOR.editorRow}:${TEST_FILE_EDITOR.editorColumn}`;
const localVue = createLocalVue();
localVue.use(Vuex);
describe('ide/components/ide_status_list', () => {
+ let activeFileEditor;
let activeFile;
let store;
let wrapper;
@@ -27,6 +31,14 @@ describe('ide/components/ide_status_list', () => {
getters: {
activeFile: () => activeFile,
},
+ modules: {
+ editor: {
+ namespaced: true,
+ getters: {
+ activeFileEditor: () => activeFileEditor,
+ },
+ },
+ },
});
wrapper = shallowMount(IdeStatusList, {
@@ -38,6 +50,7 @@ describe('ide/components/ide_status_list', () => {
beforeEach(() => {
activeFile = TEST_FILE;
+ activeFileEditor = TEST_FILE_EDITOR;
});
afterEach(() => {
@@ -47,8 +60,6 @@ describe('ide/components/ide_status_list', () => {
wrapper = null;
});
- const getEditorPosition = file => `${file.editorRow}:${file.editorColumn}`;
-
describe('with regular file', () => {
beforeEach(() => {
createComponent();
@@ -65,11 +76,11 @@ describe('ide/components/ide_status_list', () => {
});
it('shows file editor position', () => {
- expect(wrapper.text()).toContain(getEditorPosition(TEST_FILE));
+ expect(wrapper.text()).toContain(TEST_EDITOR_POSITION);
});
it('shows file language', () => {
- expect(wrapper.text()).toContain(TEST_FILE.fileLanguage);
+ expect(wrapper.text()).toContain(TEST_FILE_EDITOR.fileLanguage);
});
});
@@ -81,7 +92,7 @@ describe('ide/components/ide_status_list', () => {
});
it('does not show file editor position', () => {
- expect(wrapper.text()).not.toContain(getEditorPosition(TEST_FILE));
+ expect(wrapper.text()).not.toContain(TEST_EDITOR_POSITION);
});
});