diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-29 13:34:12 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-29 13:34:12 +0100 |
commit | ab3c8302afdbbcd608e2768f9db5e53ec4358512 (patch) | |
tree | 11362d4c118ee4d81ff0957d10cdc3c689ee3767 /spec | |
parent | c274da069d0de558613feb5bc35edc1312f5241d (diff) | |
download | gitlab-ce-ab3c8302afdbbcd608e2768f9db5e53ec4358512.tar.gz |
Fixes the diff changes buttons from toggling when scrollingchanges-bar-sticky-fix
Closes #36698
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/merge_request_tabs_spec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js index dc40244c20e..8830a2d29e5 100644 --- a/spec/javascripts/merge_request_tabs_spec.js +++ b/spec/javascripts/merge_request_tabs_spec.js @@ -295,6 +295,17 @@ import 'vendor/jquery.scrollTo'; this.class.loadDiff('/foo/bar/merge_requests/1/diffs'); }); + it('triggers scroll event when diff already loaded', function () { + spyOn(document, 'dispatchEvent'); + + this.class.diffsLoaded = true; + this.class.loadDiff('/foo/bar/merge_requests/1/diffs'); + + expect( + document.dispatchEvent, + ).toHaveBeenCalledWith(new CustomEvent('scroll')); + }); + describe('with inline diff', () => { let noteId; let noteLineNumId; |