diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-24 15:06:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-24 15:06:20 +0300 |
commit | 9c8edcd6163f03b5ffe3af3c8fbe0706e80c4306 (patch) | |
tree | 3acfff342020d2c5e18da300b9292318bdb3aefe /spec/javascripts | |
parent | bc89882970d6a14b1f72eb9c715fae90b26d066c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/line_highlighter_spec.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/javascripts/line_highlighter_spec.js b/spec/javascripts/line_highlighter_spec.js index a75470b4db8..f8f835ffdef 100644 --- a/spec/javascripts/line_highlighter_spec.js +++ b/spec/javascripts/line_highlighter_spec.js @@ -1,4 +1,4 @@ -/* eslint-disable no-var, prefer-template, no-else-return, dot-notation, no-return-assign, no-new, no-underscore-dangle */ +/* eslint-disable no-var, no-else-return, dot-notation, no-return-assign, no-new, no-underscore-dangle */ import $ from 'jquery'; import LineHighlighter from '~/line_highlighter'; @@ -8,10 +8,10 @@ describe('LineHighlighter', function() { preloadFixtures('static/line_highlighter.html'); clickLine = function(number, eventData = {}) { if ($.isEmptyObject(eventData)) { - return $('#L' + number).click(); + return $(`#L${number}`).click(); } else { const e = $.Event('click', eventData); - return $('#L' + number).trigger(e); + return $(`#L${number}`).trigger(e); } }; beforeEach(function() { @@ -42,9 +42,9 @@ describe('LineHighlighter', function() { var line; new LineHighlighter({ hash: '#L5-25' }); - expect($('.' + this.css).length).toBe(21); + expect($(`.${this.css}`).length).toBe(21); for (line = 5; line <= 25; line += 1) { - expect($('#LC' + line)).toHaveClass(this.css); + expect($(`#LC${line}`)).toHaveClass(this.css); } }); @@ -130,7 +130,7 @@ describe('LineHighlighter', function() { }); expect($('#LC13')).toHaveClass(this.css); - expect($('.' + this.css).length).toBe(1); + expect($(`.${this.css}`).length).toBe(1); }); it('sets the hash', function() { @@ -152,9 +152,9 @@ describe('LineHighlighter', function() { shiftKey: true, }); - expect($('.' + this.css).length).toBe(6); + expect($(`.${this.css}`).length).toBe(6); for (line = 15; line <= 20; line += 1) { - expect($('#LC' + line)).toHaveClass(this.css); + expect($(`#LC${line}`)).toHaveClass(this.css); } }); @@ -165,9 +165,9 @@ describe('LineHighlighter', function() { shiftKey: true, }); - expect($('.' + this.css).length).toBe(6); + expect($(`.${this.css}`).length).toBe(6); for (line = 5; line <= 10; line += 1) { - expect($('#LC' + line)).toHaveClass(this.css); + expect($(`#LC${line}`)).toHaveClass(this.css); } }); }); @@ -188,9 +188,9 @@ describe('LineHighlighter', function() { shiftKey: true, }); - expect($('.' + this.css).length).toBe(6); + expect($(`.${this.css}`).length).toBe(6); for (line = 5; line <= 10; line += 1) { - expect($('#LC' + line)).toHaveClass(this.css); + expect($(`#LC${line}`)).toHaveClass(this.css); } }); @@ -200,9 +200,9 @@ describe('LineHighlighter', function() { shiftKey: true, }); - expect($('.' + this.css).length).toBe(6); + expect($(`.${this.css}`).length).toBe(6); for (line = 10; line <= 15; line += 1) { - expect($('#LC' + line)).toHaveClass(this.css); + expect($(`#LC${line}`)).toHaveClass(this.css); } }); }); |