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/javascripts/ide')
-rw-r--r--spec/javascripts/ide/components/branches/item_spec.js3
-rw-r--r--spec/javascripts/ide/components/branches/search_list_spec.js5
-rw-r--r--spec/javascripts/ide/components/commit_sidebar/message_field_spec.js21
-rw-r--r--spec/javascripts/ide/components/file_finder/index_spec.js9
-rw-r--r--spec/javascripts/ide/components/ide_spec.js9
-rw-r--r--spec/javascripts/ide/components/ide_status_bar_spec.js3
-rw-r--r--spec/javascripts/ide/components/jobs/detail_spec.js3
-rw-r--r--spec/javascripts/ide/components/merge_requests/item_spec.js4
-rw-r--r--spec/javascripts/ide/components/merge_requests/list_spec.js5
-rw-r--r--spec/javascripts/ide/components/preview/clientside_spec.js3
-rw-r--r--spec/javascripts/ide/components/repo_editor_spec.js9
-rw-r--r--spec/javascripts/ide/components/shared/tokened_input_spec.js3
-rw-r--r--spec/javascripts/ide/stores/actions/merge_request_spec.js35
-rw-r--r--spec/javascripts/ide/stores/actions/project_spec.js5
-rw-r--r--spec/javascripts/ide/stores/modules/branches/actions_spec.js1
-rw-r--r--spec/javascripts/ide/stores/modules/pane/actions_spec.js27
-rw-r--r--spec/javascripts/ide/stores/modules/pane/getters_spec.js10
17 files changed, 60 insertions, 95 deletions
diff --git a/spec/javascripts/ide/components/branches/item_spec.js b/spec/javascripts/ide/components/branches/item_spec.js
index 249b80bbba6..36b6736bfd4 100644
--- a/spec/javascripts/ide/components/branches/item_spec.js
+++ b/spec/javascripts/ide/components/branches/item_spec.js
@@ -36,7 +36,8 @@ describe('IDE branch item', () => {
});
it('renders link to branch', () => {
- const expectedHref = router.resolve(`/project/${TEST_PROJECT_ID}/edit/${TEST_BRANCH.name}`).href;
+ const expectedHref = router.resolve(`/project/${TEST_PROJECT_ID}/edit/${TEST_BRANCH.name}`)
+ .href;
expect(vm.$el).toMatch('a');
expect(vm.$el).toHaveAttr('href', expectedHref);
diff --git a/spec/javascripts/ide/components/branches/search_list_spec.js b/spec/javascripts/ide/components/branches/search_list_spec.js
index c3f84ba1c24..72a3c2d5dcd 100644
--- a/spec/javascripts/ide/components/branches/search_list_spec.js
+++ b/spec/javascripts/ide/components/branches/search_list_spec.js
@@ -62,8 +62,9 @@ describe('IDE branches search list', () => {
});
it('renders list', () => {
- const elementText = Array.from(vm.$el.querySelectorAll('li strong'))
- .map(x => x.textContent.trim());
+ const elementText = Array.from(vm.$el.querySelectorAll('li strong')).map(x =>
+ x.textContent.trim(),
+ );
expect(elementText).toEqual(testBranches.map(x => x.name));
});
diff --git a/spec/javascripts/ide/components/commit_sidebar/message_field_spec.js b/spec/javascripts/ide/components/commit_sidebar/message_field_spec.js
index c06dfa46303..af67991eadd 100644
--- a/spec/javascripts/ide/components/commit_sidebar/message_field_spec.js
+++ b/spec/javascripts/ide/components/commit_sidebar/message_field_spec.js
@@ -36,8 +36,7 @@ describe('IDE commit message field', () => {
it('removed is-focused class on blur', done => {
vm.$el.querySelector('textarea').focus();
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.$el.querySelector('.is-focused')).not.toBeNull();
@@ -70,8 +69,7 @@ describe('IDE commit message field', () => {
it('does not highlight less than 50 characters', done => {
vm.text = 'text less than 50 chars';
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.$el.querySelector('.highlights span').textContent).toContain(
'text less than 50 chars',
@@ -87,8 +85,7 @@ describe('IDE commit message field', () => {
vm.text =
'text less than 50 chars that should not highlighted. text more than 50 should be highlighted';
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.$el.querySelector('.highlights span').textContent).toContain(
'text less than 50 chars that should not highlighte',
@@ -108,8 +105,7 @@ describe('IDE commit message field', () => {
it('does not highlight body text less tan 72 characters', done => {
vm.text = 'subject line\nbody content';
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.$el.querySelectorAll('.highlights span').length).toBe(2);
expect(vm.$el.querySelectorAll('mark')[1].style.display).toBe('none');
@@ -122,8 +118,7 @@ describe('IDE commit message field', () => {
vm.text =
'subject line\nbody content that will be highlighted when it is more than 72 characters in length';
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.$el.querySelectorAll('.highlights span').length).toBe(2);
expect(vm.$el.querySelectorAll('mark')[1].style.display).not.toBe('none');
@@ -137,8 +132,7 @@ describe('IDE commit message field', () => {
vm.text =
'text less than 50 chars that should not highlighted\nbody content that will be highlighted when it is more than 72 characters in length';
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.$el.querySelectorAll('.highlights span').length).toBe(2);
expect(vm.$el.querySelectorAll('mark').length).toBe(2);
@@ -156,8 +150,7 @@ describe('IDE commit message field', () => {
it('updates transform of highlights', done => {
vm.text = 'subject line\n\n\n\n\n\n\n\n\n\n\nbody content';
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
vm.$el.querySelector('textarea').scrollTo(0, 50);
diff --git a/spec/javascripts/ide/components/file_finder/index_spec.js b/spec/javascripts/ide/components/file_finder/index_spec.js
index 4f208e946d2..4d934f92f72 100644
--- a/spec/javascripts/ide/components/file_finder/index_spec.js
+++ b/spec/javascripts/ide/components/file_finder/index_spec.js
@@ -85,8 +85,7 @@ describe('IDE File finder item spec', () => {
it('clear button resets searchText', done => {
vm.searchText = 'index';
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
vm.$el.querySelector('.dropdown-input-clear').click();
})
@@ -102,8 +101,7 @@ describe('IDE File finder item spec', () => {
spyOn(vm.$refs.searchInput, 'focus');
vm.searchText = 'index';
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
vm.$el.querySelector('.dropdown-input-clear').click();
})
@@ -178,8 +176,7 @@ describe('IDE File finder item spec', () => {
vm.searchText = 'test';
vm.$store.state.fileFindVisible = true;
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
vm.$store.state.fileFindVisible = false;
})
diff --git a/spec/javascripts/ide/components/ide_spec.js b/spec/javascripts/ide/components/ide_spec.js
index 49b8e934cdd..c02a1ad246c 100644
--- a/spec/javascripts/ide/components/ide_spec.js
+++ b/spec/javascripts/ide/components/ide_spec.js
@@ -84,8 +84,7 @@ describe('ide component', () => {
it('calls toggleFileFinder on `t` key press', done => {
Mousetrap.trigger('t');
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.toggleFileFinder).toHaveBeenCalled();
})
@@ -96,8 +95,7 @@ describe('ide component', () => {
it('calls toggleFileFinder on `command+p` key press', done => {
Mousetrap.trigger('command+p');
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.toggleFileFinder).toHaveBeenCalled();
})
@@ -108,8 +106,7 @@ describe('ide component', () => {
it('calls toggleFileFinder on `ctrl+p` key press', done => {
Mousetrap.trigger('ctrl+p');
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
expect(vm.toggleFileFinder).toHaveBeenCalled();
})
diff --git a/spec/javascripts/ide/components/ide_status_bar_spec.js b/spec/javascripts/ide/components/ide_status_bar_spec.js
index 9874e7b597e..ab032b4cb98 100644
--- a/spec/javascripts/ide/components/ide_status_bar_spec.js
+++ b/spec/javascripts/ide/components/ide_status_bar_spec.js
@@ -78,8 +78,7 @@ describe('ideStatusBar', () => {
},
});
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
vm.$el.querySelector('.ide-status-pipeline button').click();
diff --git a/spec/javascripts/ide/components/jobs/detail_spec.js b/spec/javascripts/ide/components/jobs/detail_spec.js
index 8f8d4b9709e..a4e6b81acba 100644
--- a/spec/javascripts/ide/components/jobs/detail_spec.js
+++ b/spec/javascripts/ide/components/jobs/detail_spec.js
@@ -109,8 +109,7 @@ describe('IDE jobs detail view', () => {
vm.scrollPos = 1;
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => vm.$el.querySelector('.btn-scroll').click())
.then(() => vm.$nextTick())
.then(() => {
diff --git a/spec/javascripts/ide/components/merge_requests/item_spec.js b/spec/javascripts/ide/components/merge_requests/item_spec.js
index c92e6b89c78..155a247defb 100644
--- a/spec/javascripts/ide/components/merge_requests/item_spec.js
+++ b/spec/javascripts/ide/components/merge_requests/item_spec.js
@@ -29,7 +29,9 @@ describe('IDE merge request item', () => {
});
it('renders link with href', () => {
- const expectedHref = router.resolve(`/project/${vm.item.projectPathWithNamespace}/merge_requests/${vm.item.iid}`).href;
+ const expectedHref = router.resolve(
+ `/project/${vm.item.projectPathWithNamespace}/merge_requests/${vm.item.iid}`,
+ ).href;
expect(vm.$el).toMatch('a');
expect(vm.$el).toHaveAttr('href', expectedHref);
diff --git a/spec/javascripts/ide/components/merge_requests/list_spec.js b/spec/javascripts/ide/components/merge_requests/list_spec.js
index c761315444c..55e4f46d9ca 100644
--- a/spec/javascripts/ide/components/merge_requests/list_spec.js
+++ b/spec/javascripts/ide/components/merge_requests/list_spec.js
@@ -118,8 +118,9 @@ describe('IDE merge requests list', () => {
vm.$nextTick()
.then(() => {
const expectedSearchTypes = vm.$options.searchTypes.map(x => x.label);
- const renderedSearchTypes = Array.from(vm.$el.querySelectorAll('li'))
- .map(x => x.textContent.trim());
+ const renderedSearchTypes = Array.from(vm.$el.querySelectorAll('li')).map(x =>
+ x.textContent.trim(),
+ );
expect(renderedSearchTypes).toEqual(expectedSearchTypes);
})
diff --git a/spec/javascripts/ide/components/preview/clientside_spec.js b/spec/javascripts/ide/components/preview/clientside_spec.js
index d6983f5a3b8..b9bf5c51ffe 100644
--- a/spec/javascripts/ide/components/preview/clientside_spec.js
+++ b/spec/javascripts/ide/components/preview/clientside_spec.js
@@ -59,8 +59,7 @@ describe('IDE clientside preview', () => {
}),
);
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => vm.initPreview())
.then(vm.$nextTick)
.then(done)
diff --git a/spec/javascripts/ide/components/repo_editor_spec.js b/spec/javascripts/ide/components/repo_editor_spec.js
index d9136d636d0..002b5a005b8 100644
--- a/spec/javascripts/ide/components/repo_editor_spec.js
+++ b/spec/javascripts/ide/components/repo_editor_spec.js
@@ -125,8 +125,7 @@ describe('RepoEditor', () => {
vm.file.path = `${vm.file.path}.md`;
vm.$store.state.entries[vm.file.path] = vm.file;
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
vm.$el.querySelectorAll('.ide-mode-tabs .nav-links a')[1].click();
})
@@ -297,8 +296,7 @@ describe('RepoEditor', () => {
it('calls updateDimensions when panelResizing is false', done => {
vm.$store.state.panelResizing = true;
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
vm.$store.state.panelResizing = false;
})
@@ -366,8 +364,7 @@ describe('RepoEditor', () => {
vm.file.pending = true;
- vm
- .$nextTick()
+ vm.$nextTick()
.then(() => {
vm.file = file('testing');
diff --git a/spec/javascripts/ide/components/shared/tokened_input_spec.js b/spec/javascripts/ide/components/shared/tokened_input_spec.js
index 935ee0beea8..b09bf760543 100644
--- a/spec/javascripts/ide/components/shared/tokened_input_spec.js
+++ b/spec/javascripts/ide/components/shared/tokened_input_spec.js
@@ -44,8 +44,7 @@ describe('IDE shared/TokenedInput', () => {
});
it('renders tokens', () => {
- const renderedTokens = getTokenElements(vm)
- .map(x => x.textContent.trim());
+ const renderedTokens = getTokenElements(vm).map(x => x.textContent.trim());
expect(renderedTokens).toEqual(TEST_TOKENS.map(x => x.label));
});
diff --git a/spec/javascripts/ide/stores/actions/merge_request_spec.js b/spec/javascripts/ide/stores/actions/merge_request_spec.js
index c4fd2c56315..3a4e0d7507f 100644
--- a/spec/javascripts/ide/stores/actions/merge_request_spec.js
+++ b/spec/javascripts/ide/stores/actions/merge_request_spec.js
@@ -262,7 +262,7 @@ describe('IDE store merge request actions', () => {
bar: {},
};
- spyOn(store, 'dispatch').and.callFake((type) => {
+ spyOn(store, 'dispatch').and.callFake(type => {
switch (type) {
case 'getMergeRequestData':
return Promise.resolve(testMergeRequest);
@@ -280,14 +280,20 @@ describe('IDE store merge request actions', () => {
expect(store.dispatch.calls.allArgs()).toEqual([
['getMergeRequestData', mr],
['setCurrentBranchId', testMergeRequest.source_branch],
- ['getBranchData', {
- projectId: mr.projectId,
- branchId: testMergeRequest.source_branch,
- }],
- ['getFiles', {
- projectId: mr.projectId,
- branchId: testMergeRequest.source_branch,
- }],
+ [
+ 'getBranchData',
+ {
+ projectId: mr.projectId,
+ branchId: testMergeRequest.source_branch,
+ },
+ ],
+ [
+ 'getFiles',
+ {
+ projectId: mr.projectId,
+ branchId: testMergeRequest.source_branch,
+ },
+ ],
['getMergeRequestVersions', mr],
['getMergeRequestChanges', mr],
]);
@@ -297,14 +303,14 @@ describe('IDE store merge request actions', () => {
});
it('updates activity bar view and gets file data, if changes are found', done => {
- testMergeRequestChanges.changes = [
- { new_path: 'foo' },
- { new_path: 'bar' },
- ];
+ testMergeRequestChanges.changes = [{ new_path: 'foo' }, { new_path: 'bar' }];
openMergeRequest(store, mr)
.then(() => {
- expect(store.dispatch).toHaveBeenCalledWith('updateActivityBarView', activityBarViews.review);
+ expect(store.dispatch).toHaveBeenCalledWith(
+ 'updateActivityBarView',
+ activityBarViews.review,
+ );
testMergeRequestChanges.changes.forEach((change, i) => {
expect(store.dispatch).toHaveBeenCalledWith('setFileMrChange', {
@@ -335,7 +341,6 @@ describe('IDE store merge request actions', () => {
})
.then(done)
.catch(done.fail);
-
});
});
});
diff --git a/spec/javascripts/ide/stores/actions/project_spec.js b/spec/javascripts/ide/stores/actions/project_spec.js
index 667e3e0a7ef..7d8c9edd965 100644
--- a/spec/javascripts/ide/stores/actions/project_spec.js
+++ b/spec/javascripts/ide/stores/actions/project_spec.js
@@ -270,7 +270,10 @@ describe('IDE store project actions', () => {
it('does not handle tree entry action, if entry is pending', done => {
openBranch(store, { ...branch, basePath: 'foo/bar-pending' })
.then(() => {
- expect(store.dispatch).not.toHaveBeenCalledWith('handleTreeEntryAction', jasmine.anything());
+ expect(store.dispatch).not.toHaveBeenCalledWith(
+ 'handleTreeEntryAction',
+ jasmine.anything(),
+ );
})
.then(done)
.catch(done.fail);
diff --git a/spec/javascripts/ide/stores/modules/branches/actions_spec.js b/spec/javascripts/ide/stores/modules/branches/actions_spec.js
index 010f56af03b..2b3eac282f6 100644
--- a/spec/javascripts/ide/stores/modules/branches/actions_spec.js
+++ b/spec/javascripts/ide/stores/modules/branches/actions_spec.js
@@ -60,7 +60,6 @@ describe('IDE branches actions', () => {
describe('receiveBranchesError', () => {
it('should should commit error', done => {
-
testAction(
receiveBranchesError,
{ search: TEST_SEARCH },
diff --git a/spec/javascripts/ide/stores/modules/pane/actions_spec.js b/spec/javascripts/ide/stores/modules/pane/actions_spec.js
index f150ded6df5..799bc89a0c3 100644
--- a/spec/javascripts/ide/stores/modules/pane/actions_spec.js
+++ b/spec/javascripts/ide/stores/modules/pane/actions_spec.js
@@ -19,27 +19,13 @@ describe('IDE pane module actions', () => {
});
it('dispatches close if opened', done => {
- testAction(
- actions.toggleOpen,
- TEST_VIEW,
- { isOpen: true },
- [],
- [{ type: 'close' }],
- done,
- );
+ testAction(actions.toggleOpen, TEST_VIEW, { isOpen: true }, [], [{ type: 'close' }], done);
});
});
describe('open', () => {
it('commits SET_OPEN', done => {
- testAction(
- actions.open,
- null,
- {},
- [{ type: types.SET_OPEN, payload: true }],
- [],
- done,
- );
+ testAction(actions.open, null, {}, [{ type: types.SET_OPEN, payload: true }], [], done);
});
it('commits SET_CURRENT_VIEW if view is given', done => {
@@ -74,14 +60,7 @@ describe('IDE pane module actions', () => {
describe('close', () => {
it('commits SET_OPEN', done => {
- testAction(
- actions.close,
- null,
- {},
- [{ type: types.SET_OPEN, payload: false }],
- [],
- done,
- );
+ testAction(actions.close, null, {}, [{ type: types.SET_OPEN, payload: false }], [], done);
});
});
});
diff --git a/spec/javascripts/ide/stores/modules/pane/getters_spec.js b/spec/javascripts/ide/stores/modules/pane/getters_spec.js
index 2060863b5d6..8a213323de0 100644
--- a/spec/javascripts/ide/stores/modules/pane/getters_spec.js
+++ b/spec/javascripts/ide/stores/modules/pane/getters_spec.js
@@ -23,10 +23,7 @@ describe('IDE pane module getters', () => {
describe('isAliveView', () => {
it('returns true if given view is in keepAliveViews', () => {
- const result = getters.isAliveView(
- { keepAliveViews: TEST_KEEP_ALIVE_VIEWS },
- {},
- )(TEST_VIEW);
+ const result = getters.isAliveView({ keepAliveViews: TEST_KEEP_ALIVE_VIEWS }, {})(TEST_VIEW);
expect(result).toBe(true);
});
@@ -41,10 +38,7 @@ describe('IDE pane module getters', () => {
});
it('returns false if given view is active view and closed', () => {
- const result = getters.isAliveView(
- state(),
- { isActiveView: () => true },
- )(TEST_VIEW);
+ const result = getters.isAliveView(state(), { isActiveView: () => true })(TEST_VIEW);
expect(result).toBe(false);
});