diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-02-23 04:27:06 +0300 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-03-13 19:58:59 +0300 |
commit | c0242485393fe93397ee18889bc5345b67d5ea0d (patch) | |
tree | 0624b5935c916ba89360c3ef8e3acc54b88feb78 /spec/javascripts/line_highlighter_spec.js | |
parent | 1d4b11f3388ddd7cf0076f95ac26196f6949dc0b (diff) |
Update permalink/blame buttons with line number fragment hash
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/19742
Diffstat (limited to 'spec/javascripts/line_highlighter_spec.js')
-rw-r--r-- | spec/javascripts/line_highlighter_spec.js | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/spec/javascripts/line_highlighter_spec.js b/spec/javascripts/line_highlighter_spec.js index a0b2ebc221b..a1fd2d38968 100644 --- a/spec/javascripts/line_highlighter_spec.js +++ b/spec/javascripts/line_highlighter_spec.js @@ -7,16 +7,12 @@ require('~/line_highlighter'); describe('LineHighlighter', function() { var clickLine; preloadFixtures('static/line_highlighter.html.raw'); - clickLine = function(number, eventData) { - var e; - if (eventData == null) { - eventData = {}; - } + clickLine = function(number, eventData = {}) { if ($.isEmptyObject(eventData)) { - return $("#L" + number).mousedown().click(); + return $("#L" + number).click(); } else { - e = $.Event('mousedown', eventData); - return $("#L" + number).trigger(e).click(); + const e = $.Event('click', eventData); + return $("#L" + number).trigger(e); } }; beforeEach(function() { @@ -63,12 +59,6 @@ require('~/line_highlighter'); }); }); describe('#clickHandler', function() { - it('discards the mousedown event', function() { - var spy; - spy = spyOnEvent('a[data-line-number]', 'mousedown'); - clickLine(13); - return expect(spy).toHaveBeenPrevented(); - }); it('handles clicking on a child icon element', function() { var spy; spy = spyOn(this["class"], 'setHash').and.callThrough(); |