diff options
Diffstat (limited to 'spec/frontend/error_tracking/components/error_details_spec.js')
-rw-r--r-- | spec/frontend/error_tracking/components/error_details_spec.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/frontend/error_tracking/components/error_details_spec.js b/spec/frontend/error_tracking/components/error_details_spec.js index fd2164d05fc..6124602e038 100644 --- a/spec/frontend/error_tracking/components/error_details_spec.js +++ b/spec/frontend/error_tracking/components/error_details_spec.js @@ -3,7 +3,7 @@ import Vuex from 'vuex'; import { __ } from '~/locale'; import createFlash from '~/flash'; import { - GlDeprecatedButton, + GlButton, GlLoadingIcon, GlLink, GlBadge, @@ -48,10 +48,11 @@ describe('ErrorDetails', () => { const findUpdateResolveStatusButton = () => wrapper.find('[data-testid="update-resolve-status-btn"]'); const findExternalUrl = () => wrapper.find('[data-testid="external-url-link"]'); + const findAlert = () => wrapper.find(GlAlert); function mountComponent() { wrapper = shallowMount(ErrorDetails, { - stubs: { GlDeprecatedButton, GlSprintf }, + stubs: { GlButton, GlSprintf }, localVue, store, mocks, @@ -194,7 +195,7 @@ describe('ErrorDetails', () => { expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); expect(wrapper.find(Stacktrace).exists()).toBe(false); expect(wrapper.find(GlBadge).exists()).toBe(false); - expect(wrapper.findAll(GlDeprecatedButton).length).toBe(3); + expect(wrapper.findAll(GlButton)).toHaveLength(3); }); describe('unsafe chars for culprit field', () => { @@ -278,15 +279,17 @@ describe('ErrorDetails', () => { return wrapper.vm.$nextTick().then(() => { expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); expect(wrapper.find(Stacktrace).exists()).toBe(true); + expect(findAlert().exists()).toBe(false); }); }); - it('should NOT show stacktrace if no entries', () => { + it('should NOT show stacktrace if no entries and show Alert message', () => { store.state.details.loadingStacktrace = false; store.getters = { 'details/sentryUrl': () => 'sentry.io', 'details/stacktrace': () => [] }; return wrapper.vm.$nextTick().then(() => { expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); expect(wrapper.find(Stacktrace).exists()).toBe(false); + expect(findAlert().text()).toBe('No stack trace for this error'); }); }); }); @@ -404,7 +407,6 @@ describe('ErrorDetails', () => { }); it('should show alert with closed issueId', () => { - const findAlert = () => wrapper.find(GlAlert); const closedIssueId = 123; wrapper.setData({ isAlertVisible: true, |