summaryrefslogtreecommitdiff
path: root/spec/frontend/reports/components/report_link_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/reports/components/report_link_spec.js')
-rw-r--r--spec/frontend/reports/components/report_link_spec.js56
1 files changed, 0 insertions, 56 deletions
diff --git a/spec/frontend/reports/components/report_link_spec.js b/spec/frontend/reports/components/report_link_spec.js
deleted file mode 100644
index 2ed0617a598..00000000000
--- a/spec/frontend/reports/components/report_link_spec.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import { shallowMount } from '@vue/test-utils';
-import ReportLink from '~/reports/components/report_link.vue';
-
-describe('app/assets/javascripts/reports/components/report_link.vue', () => {
- let wrapper;
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- const defaultProps = {
- issue: {},
- };
-
- const createComponent = (props = {}) => {
- wrapper = shallowMount(ReportLink, {
- propsData: { ...defaultProps, ...props },
- });
- };
-
- describe('When an issue prop has a $urlPath property', () => {
- it('render a link that will take the user to the $urlPath', () => {
- createComponent({ issue: { path: 'Gemfile.lock', urlPath: '/Gemfile.lock' } });
-
- expect(wrapper.text()).toContain('in');
- expect(wrapper.find('a').attributes('href')).toBe('/Gemfile.lock');
- expect(wrapper.find('a').text()).toContain('Gemfile.lock');
- });
- });
-
- describe('When an issue prop has no $urlPath property', () => {
- it('does not render link', () => {
- createComponent({ issue: { path: 'Gemfile.lock' } });
-
- expect(wrapper.find('a').exists()).toBe(false);
- expect(wrapper.text()).toContain('in');
- expect(wrapper.text()).toContain('Gemfile.lock');
- });
- });
-
- describe('When an issue prop has a $line property', () => {
- it('render a line number', () => {
- createComponent({ issue: { path: 'Gemfile.lock', urlPath: '/Gemfile.lock', line: 22 } });
-
- expect(wrapper.find('a').text()).toContain('Gemfile.lock:22');
- });
- });
-
- describe('When an issue prop does not have a $line property', () => {
- it('does not render a line number', () => {
- createComponent({ issue: { urlPath: '/Gemfile.lock' } });
-
- expect(wrapper.find('a').text()).not.toContain(':22');
- });
- });
-});