summaryrefslogtreecommitdiff
path: root/spec/frontend
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-22 18:00:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-22 18:00:36 +0000
commitd8a7223a9ae47971ee3ed3070f5d42f7d9aa2690 (patch)
treee84e06a07d4888eb4424aebfa802d7c8030bf6b9 /spec/frontend
parent9cf4cc503860dd3b836cf423d88d067f4d120591 (diff)
downloadgitlab-ce-d8a7223a9ae47971ee3ed3070f5d42f7d9aa2690.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-ee
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/jobs/components/log/line_spec.js65
1 files changed, 13 insertions, 52 deletions
diff --git a/spec/frontend/jobs/components/log/line_spec.js b/spec/frontend/jobs/components/log/line_spec.js
index 1a30921fece..c2412a807c3 100644
--- a/spec/frontend/jobs/components/log/line_spec.js
+++ b/spec/frontend/jobs/components/log/line_spec.js
@@ -2,25 +2,21 @@ import { shallowMount } from '@vue/test-utils';
import Line from '~/jobs/components/log/line.vue';
import LineNumber from '~/jobs/components/log/line_number.vue';
-const httpUrl = 'http://example.com';
-const httpsUrl = 'https://example.com';
-
-const mockProps = ({ text = 'Running with gitlab-runner 12.1.0 (de7731dd)' } = {}) => ({
- line: {
- content: [
- {
- text,
- style: 'term-fg-l-green',
- },
- ],
- lineNumber: 0,
- },
- path: '/jashkenas/underscore/-/jobs/335',
-});
-
describe('Job Log Line', () => {
let wrapper;
- let data;
+
+ const data = {
+ line: {
+ content: [
+ {
+ text: 'Running with gitlab-runner 12.1.0 (de7731dd)',
+ style: 'term-fg-l-green',
+ },
+ ],
+ lineNumber: 0,
+ },
+ path: '/jashkenas/underscore/-/jobs/335',
+ };
const createComponent = (props = {}) => {
wrapper = shallowMount(Line, {
@@ -31,7 +27,6 @@ describe('Job Log Line', () => {
};
beforeEach(() => {
- data = mockProps();
createComponent(data);
});
@@ -50,38 +45,4 @@ describe('Job Log Line', () => {
it('renders the provided style as a class attribute', () => {
expect(wrapper.find('span').classes()).toContain(data.line.content[0].style);
});
-
- describe('when the line contains a link', () => {
- const findLink = () => wrapper.find('span a');
-
- it('renders an http link', () => {
- createComponent(mockProps({ text: httpUrl }));
-
- expect(findLink().text()).toBe(httpUrl);
- expect(findLink().attributes().href).toEqual(httpUrl);
- });
-
- it('renders an https link', () => {
- createComponent(mockProps({ text: httpsUrl }));
-
- expect(findLink().text()).toBe(httpsUrl);
- expect(findLink().attributes().href).toEqual(httpsUrl);
- });
-
- it('renders a link with rel nofollow and noopener', () => {
- createComponent(mockProps({ text: httpsUrl }));
-
- expect(findLink().attributes().rel).toBe('nofollow noopener');
- });
-
- test.each`
- type | text
- ${'ftp'} | ${'ftp://example.com/file'}
- ${'email'} | ${'email@example.com'}
- ${'no scheme'} | ${'example.com/page'}
- `('does not render a $type link', ({ text }) => {
- createComponent(mockProps({ text }));
- expect(findLink().exists()).toBe(false);
- });
- });
});