diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
commit | db384e6b19af03b4c3c82a5760d83a3fd79f7982 (patch) | |
tree | 34beaef37df5f47ccbcf5729d7583aae093cffa0 /spec/frontend/jobs/components/log/line_header_spec.js | |
parent | 54fd7b1bad233e3944434da91d257fa7f63c3996 (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-eev16.3.0-rc42
Diffstat (limited to 'spec/frontend/jobs/components/log/line_header_spec.js')
-rw-r--r-- | spec/frontend/jobs/components/log/line_header_spec.js | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/frontend/jobs/components/log/line_header_spec.js b/spec/frontend/jobs/components/log/line_header_spec.js index 16fe753e08a..c02d8c22655 100644 --- a/spec/frontend/jobs/components/log/line_header_spec.js +++ b/spec/frontend/jobs/components/log/line_header_spec.js @@ -1,5 +1,6 @@ import { mount } from '@vue/test-utils'; import { nextTick } from 'vue'; +import setWindowLocation from 'helpers/set_window_location_helper'; import DurationBadge from '~/jobs/components/log/duration_badge.vue'; import LineHeader from '~/jobs/components/log/line_header.vue'; import LineNumber from '~/jobs/components/log/line_number.vue'; @@ -15,7 +16,7 @@ describe('Job Log Header Line', () => { style: 'term-fg-l-green', }, ], - lineNumber: 0, + lineNumber: 76, }, isClosed: true, path: '/jashkenas/underscore/-/jobs/335', @@ -89,4 +90,30 @@ describe('Job Log Header Line', () => { expect(wrapper.findComponent(DurationBadge).exists()).toBe(true); }); }); + + describe('line highlighting', () => { + describe('with hash', () => { + beforeEach(() => { + setWindowLocation(`http://foo.com/root/ci-project/-/jobs/6353#L77`); + + createComponent(data); + }); + + it('highlights line', () => { + expect(wrapper.classes()).toContain('gl-bg-gray-700'); + }); + }); + + describe('without hash', () => { + beforeEach(() => { + setWindowLocation(`http://foo.com/root/ci-project/-/jobs/6353`); + + createComponent(data); + }); + + it('does not highlight line', () => { + expect(wrapper.classes()).not.toContain('gl-bg-gray-700'); + }); + }); + }); }); |