summaryrefslogtreecommitdiff
path: root/spec/javascripts/merge_request_tabs_spec.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-12-20 09:47:43 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-12-20 09:47:43 +0000
commit800ab47a53ea1dfaabdb67501360a14322268315 (patch)
treef6bb2327510806a066cc3776120a2d92b23cc205 /spec/javascripts/merge_request_tabs_spec.js
parent572de0c1c2788d8d434a967f6ef0cb144f7f668f (diff)
parentfebb0b9a8014f5b480ff7baab1d189fce49210a5 (diff)
downloadgitlab-ce-800ab47a53ea1dfaabdb67501360a14322268315.tar.gz
Merge branch 'master' into 22643-manual-job-page
* master: (50 commits) Prevent some specs from mangling the gitlab-shell checkout Line up search dropdown with other nav dropdowns Fix onion-skin re-entering state Remove related links in MR widget when empty state Show inline edit button for issues Fix tags in the Activity tab not being clickable Fix shortcut links on help page Don't link LFS-objects multiple times. [CE->EE] Fix spec/lib/gitlab/git/gitlab_projects_spec.rb Tidy up the documentation of Gitlab HA/Gitlab Application Make sure two except won't overwrite each other Update axios.md Remove transitionend event from GL dropdown Preserve gem path so that we use the same gems Load commit in batches for pipelines#index BlobViewer::PackageJson - if private link to homepage Do not generate links for private NPM modules in blob view Fix missing WHERE clause in 20171106135924_issues_milestone_id_foreign_key migration Inverse the has_multiple_clusters? helper usage Remove block styling from search dropdown ...
Diffstat (limited to 'spec/javascripts/merge_request_tabs_spec.js')
-rw-r--r--spec/javascripts/merge_request_tabs_spec.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js
index 31426ceb110..050f0ea9ebd 100644
--- a/spec/javascripts/merge_request_tabs_spec.js
+++ b/spec/javascripts/merge_request_tabs_spec.js
@@ -1,5 +1,4 @@
/* eslint-disable no-var, comma-dangle, object-shorthand */
-/* global Notes */
import * as urlUtils from '~/lib/utils/url_utility';
import MergeRequestTabs from '~/merge_request_tabs';
@@ -7,7 +6,7 @@ import '~/commit/pipelines/pipelines_bundle';
import '~/breakpoints';
import '~/lib/utils/common_utils';
import Diff from '~/diff';
-import '~/notes';
+import Notes from '~/notes';
import 'vendor/jquery.scrollTo';
(function () {
@@ -279,8 +278,8 @@ import 'vendor/jquery.scrollTo';
loadFixtures('merge_requests/diff_comment.html.raw');
$('body').attr('data-page', 'projects:merge_requests:show');
window.gl.ImageFile = () => {};
- window.notes = new Notes('', []);
- spyOn(window.notes, 'toggleDiffNote').and.callThrough();
+ Notes.initialize('', []);
+ spyOn(Notes.instance, 'toggleDiffNote').and.callThrough();
});
afterEach(() => {
@@ -338,7 +337,7 @@ import 'vendor/jquery.scrollTo';
this.class.loadDiff('/foo/bar/merge_requests/1/diffs');
expect(noteId.length).toBeGreaterThan(0);
- expect(window.notes.toggleDiffNote).toHaveBeenCalledWith({
+ expect(Notes.instance.toggleDiffNote).toHaveBeenCalledWith({
target: jasmine.any(Object),
lineType: 'old',
forceShow: true,
@@ -349,7 +348,7 @@ import 'vendor/jquery.scrollTo';
spyOn(urlUtils, 'getLocationHash').and.returnValue('note_something-that-does-not-exist');
this.class.loadDiff('/foo/bar/merge_requests/1/diffs');
- expect(window.notes.toggleDiffNote).not.toHaveBeenCalled();
+ expect(Notes.instance.toggleDiffNote).not.toHaveBeenCalled();
});
});
@@ -359,7 +358,7 @@ import 'vendor/jquery.scrollTo';
this.class.loadDiff('/foo/bar/merge_requests/1/diffs');
expect(noteLineNumId.length).toBeGreaterThan(0);
- expect(window.notes.toggleDiffNote).not.toHaveBeenCalled();
+ expect(Notes.instance.toggleDiffNote).not.toHaveBeenCalled();
});
});
});
@@ -393,7 +392,7 @@ import 'vendor/jquery.scrollTo';
this.class.loadDiff('/foo/bar/merge_requests/1/diffs');
expect(noteId.length).toBeGreaterThan(0);
- expect(window.notes.toggleDiffNote).toHaveBeenCalledWith({
+ expect(Notes.instance.toggleDiffNote).toHaveBeenCalledWith({
target: jasmine.any(Object),
lineType: 'new',
forceShow: true,
@@ -404,7 +403,7 @@ import 'vendor/jquery.scrollTo';
spyOn(urlUtils, 'getLocationHash').and.returnValue('note_something-that-does-not-exist');
this.class.loadDiff('/foo/bar/merge_requests/1/diffs');
- expect(window.notes.toggleDiffNote).not.toHaveBeenCalled();
+ expect(Notes.instance.toggleDiffNote).not.toHaveBeenCalled();
});
});
@@ -414,7 +413,7 @@ import 'vendor/jquery.scrollTo';
this.class.loadDiff('/foo/bar/merge_requests/1/diffs');
expect(noteLineNumId.length).toBeGreaterThan(0);
- expect(window.notes.toggleDiffNote).not.toHaveBeenCalled();
+ expect(Notes.instance.toggleDiffNote).not.toHaveBeenCalled();
});
});
});