Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/line_highlighter_spec.js')
-rw-r--r--spec/frontend/line_highlighter_spec.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/frontend/line_highlighter_spec.js b/spec/frontend/line_highlighter_spec.js
index b5a0adc9d49..97ae6c0e3b7 100644
--- a/spec/frontend/line_highlighter_spec.js
+++ b/spec/frontend/line_highlighter_spec.js
@@ -49,6 +49,15 @@ describe('LineHighlighter', () => {
}
});
+ it('highlights a range of lines given in the URL hash using GitHub format', () => {
+ new LineHighlighter({ hash: '#L5-L25' });
+
+ expect($(`.${testContext.css}`).length).toBe(21);
+ for (let line = 5; line <= 25; line += 1) {
+ expect($(`#LC${line}`)).toHaveClass(testContext.css);
+ }
+ });
+
it('scrolls to the first highlighted line on initial load', () => {
jest.spyOn(utils, 'scrollToElement');
new LineHighlighter({ hash: '#L5-25' });