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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-27 18:09:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-27 18:09:25 +0300
commite69aae81ead38d4740771a5c8f0f33a4f248a312 (patch)
treeedeff4f4658db5ec3b3d6f658ddf018598af95bc /spec/frontend/incidents
parent8827c1d18473a3d84db181c89212975418a25e37 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/incidents')
-rw-r--r--spec/frontend/incidents/components/incidents_list_spec.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/frontend/incidents/components/incidents_list_spec.js b/spec/frontend/incidents/components/incidents_list_spec.js
index 873b1b67bba..eb339fdaa90 100644
--- a/spec/frontend/incidents/components/incidents_list_spec.js
+++ b/spec/frontend/incidents/components/incidents_list_spec.js
@@ -1,10 +1,17 @@
import { mount } from '@vue/test-utils';
import { GlAlert, GlLoadingIcon, GlTable, GlAvatar } from '@gitlab/ui';
+import { visitUrl, joinPaths } from '~/lib/utils/url_utility';
import IncidentsList from '~/incidents/components/incidents_list.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { I18N } from '~/incidents/constants';
import mockIncidents from '../mocks/incidents.json';
+jest.mock('~/lib/utils/url_utility', () => ({
+ visitUrl: jest.fn().mockName('visitUrlMock'),
+ joinPaths: jest.fn().mockName('joinPaths'),
+ mergeUrlParams: jest.fn().mockName('mergeUrlParams'),
+}));
+
describe('Incidents List', () => {
let wrapper;
const newIssuePath = 'namespace/project/-/issues/new';
@@ -36,6 +43,7 @@ describe('Incidents List', () => {
projectPath: '/project/path',
newIssuePath,
incidentTemplateName,
+ issuePath: '/project/isssues',
},
stubs: {
GlButton: true,
@@ -111,6 +119,13 @@ describe('Incidents List', () => {
expect(label).toBe(name);
expect(src).toBe(avatarUrl);
});
+
+ it('contains a link to the issue details', () => {
+ findTableRows()
+ .at(0)
+ .trigger('click');
+ expect(visitUrl).toHaveBeenCalledWith(joinPaths(`/project/isssues/`, mockIncidents[0].iid));
+ });
});
});
@@ -124,9 +139,6 @@ describe('Incidents List', () => {
it('shows the button linking to new incidents page with prefilled incident template', () => {
expect(findCreateIncidentBtn().exists()).toBe(true);
- expect(findCreateIncidentBtn().attributes('href')).toBe(
- `${newIssuePath}?issuable_template=${incidentTemplateName}`,
- );
});
it('sets button loading on click', () => {