summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-03-13 19:35:18 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2017-03-13 19:35:18 +0000
commit08f7e49d2980dcb23902cec3324a61dd8ba9c0e9 (patch)
treea7f023e704242bd944bc7d463562c5e77a4aa549 /spec/javascripts
parentcc4ca1f3fe2e2f7470c4fae9a9c5676bbebb18b6 (diff)
parentc0242485393fe93397ee18889bc5345b67d5ea0d (diff)
downloadgitlab-ce-08f7e49d2980dcb23902cec3324a61dd8ba9c0e9.tar.gz
Merge branch '19742-permalink-blame-button-line-number-hash-links' into 'master'
Update permalink/blame buttons with line number fragment hash Closes #19742 See merge request !9461
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/line_highlighter_spec.js18
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();