diff options
Diffstat (limited to 'spec/frontend/error_tracking')
-rw-r--r-- | spec/frontend/error_tracking/components/error_details_spec.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/spec/frontend/error_tracking/components/error_details_spec.js b/spec/frontend/error_tracking/components/error_details_spec.js index 1e1d20800da..cfb9ce51979 100644 --- a/spec/frontend/error_tracking/components/error_details_spec.js +++ b/spec/frontend/error_tracking/components/error_details_spec.js @@ -1,7 +1,7 @@ import { createLocalVue, shallowMount } from '@vue/test-utils'; import Vuex from 'vuex'; import { __ } from '~/locale'; -import { GlLoadingIcon, GlLink, GlBadge, GlFormInput } from '@gitlab/ui'; +import { GlLoadingIcon, GlLink, GlBadge, GlFormInput, GlAlert, GlSprintf } from '@gitlab/ui'; import LoadingButton from '~/vue_shared/components/loading_button.vue'; import Stacktrace from '~/error_tracking/components/stacktrace.vue'; import ErrorDetails from '~/error_tracking/components/error_details.vue'; @@ -28,7 +28,7 @@ describe('ErrorDetails', () => { function mountComponent() { wrapper = shallowMount(ErrorDetails, { - stubs: { LoadingButton }, + stubs: { LoadingButton, GlSprintf }, localVue, store, mocks, @@ -62,7 +62,7 @@ describe('ErrorDetails', () => { startPollingDetails: () => {}, startPollingStacktrace: () => {}, updateIgnoreStatus: jest.fn(), - updateResolveStatus: jest.fn(), + updateResolveStatus: jest.fn().mockResolvedValue({ closed_issue_iid: 1 }), }; getters = { @@ -313,6 +313,20 @@ describe('ErrorDetails', () => { expect.objectContaining({ status: errorStatus.UNRESOLVED }), ); }); + + it('should show alert with closed issueId', () => { + const findAlert = () => wrapper.find(GlAlert); + const closedIssueId = 123; + wrapper.setData({ + isAlertVisible: true, + closedIssueId, + }); + + return wrapper.vm.$nextTick().then(() => { + expect(findAlert().exists()).toBe(true); + expect(findAlert().text()).toContain(`#${closedIssueId}`); + }); + }); }); }); |