Commit b0763264 authored by Eric Eastwood's avatar Eric Eastwood

Use promise syntax with Helper.getContent

Fix
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12198#note_37143217

Conflicts:
	app/assets/javascripts/repo/helpers/repo_helper.js
parent 2c3593f6
...@@ -65,9 +65,10 @@ describe('RepoSidebar', () => { ...@@ -65,9 +65,10 @@ describe('RepoSidebar', () => {
describe('methods', () => { describe('methods', () => {
describe('fileClicked', () => { describe('fileClicked', () => {
it('should fetch data for new file', () => { it('should fetch data for new file', () => {
spyOn(Helper, 'getContent'); spyOn(Helper, 'getContent').and.callThrough();
const file1 = { const file1 = {
id: 0, id: 0,
url: '',
}; };
RepoStore.files = [file1]; RepoStore.files = [file1];
RepoStore.isRoot = true; RepoStore.isRoot = true;
...@@ -75,7 +76,7 @@ describe('RepoSidebar', () => { ...@@ -75,7 +76,7 @@ describe('RepoSidebar', () => {
vm.fileClicked(file1); vm.fileClicked(file1);
expect(Helper.getContent).toHaveBeenCalledWith(file1, jasmine.any(Function)); expect(Helper.getContent).toHaveBeenCalledWith(file1);
}); });
it('should hide files in directory if already open', () => { it('should hide files in directory if already open', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment