diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/frontend/ide/components/ide_status_list_spec.js | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/frontend/ide/components/ide_status_list_spec.js')
-rw-r--r-- | spec/frontend/ide/components/ide_status_list_spec.js | 27 |
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); }); }); |