summaryrefslogtreecommitdiff
path: root/spec/frontend/error_tracking
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 12:07:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 12:07:55 +0000
commit5e11c9b77cb1b2b77ee29359047b55807afe255d (patch)
tree40b02dead6acdcaab9cc15efc9ae4710c2ed78a8 /spec/frontend/error_tracking
parent97d4d926630822d0e1a638206909679c962d2f0a (diff)
downloadgitlab-ce-5e11c9b77cb1b2b77ee29359047b55807afe255d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/error_tracking')
-rw-r--r--spec/frontend/error_tracking/components/error_details_spec.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/frontend/error_tracking/components/error_details_spec.js b/spec/frontend/error_tracking/components/error_details_spec.js
index 72f3577c530..632ed373545 100644
--- a/spec/frontend/error_tracking/components/error_details_spec.js
+++ b/spec/frontend/error_tracking/components/error_details_spec.js
@@ -138,5 +138,48 @@ describe('ErrorDetails', () => {
submitSpy.mockRestore();
});
});
+
+ describe('GitLab issue link', () => {
+ const gitlabIssue = 'https://gitlab.example.com/issues/1';
+ const findGitLabLink = () => wrapper.find(`[href="${gitlabIssue}"]`);
+ const findCreateIssueButton = () => wrapper.find('[data-qa-selector="create_issue_button"]');
+
+ describe('is present', () => {
+ beforeEach(() => {
+ store.state.details.loading = false;
+ store.state.details.error = {
+ id: 1,
+ gitlab_issue: gitlabIssue,
+ };
+ mountComponent();
+ });
+
+ it('should display the issue link', () => {
+ expect(findGitLabLink().exists()).toBe(true);
+ });
+
+ it('should not display a create issue button', () => {
+ expect(findCreateIssueButton().exists()).toBe(false);
+ });
+ });
+
+ describe('is not present', () => {
+ beforeEach(() => {
+ store.state.details.loading = false;
+ store.state.details.error = {
+ id: 1,
+ gitlab_issue: null,
+ };
+ mountComponent();
+ });
+
+ it('should not display an issue link', () => {
+ expect(findGitLabLink().exists()).toBe(false);
+ });
+ it('should display the create issue button', () => {
+ expect(findCreateIssueButton().exists()).toBe(true);
+ });
+ });
+ });
});
});