diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-10 03:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-10 03:08:36 +0300 |
commit | 237ead18b945830ed60ac1b4382a4431d66818a6 (patch) | |
tree | 60532f9b8ee5e7dfbbdd08fdedc211b1e7b8d784 /spec/frontend/error_tracking | |
parent | 1bcebb67d554d95aa77d4cf42b22e7c96e1c8527 (diff) |
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.js | 6 | ||||
-rw-r--r-- | spec/frontend/error_tracking/components/error_tracking_list_spec.js | 63 |
2 files changed, 48 insertions, 21 deletions
diff --git a/spec/frontend/error_tracking/components/error_details_spec.js b/spec/frontend/error_tracking/components/error_details_spec.js index 03ae437a89e..4273da6c735 100644 --- a/spec/frontend/error_tracking/components/error_details_spec.js +++ b/spec/frontend/error_tracking/components/error_details_spec.js @@ -10,11 +10,7 @@ import { import { shallowMount } from '@vue/test-utils'; import Vue, { nextTick } from 'vue'; import Vuex from 'vuex'; -import { - severityLevel, - severityLevelVariant, - errorStatus, -} from '~/error_tracking/components/constants'; +import { severityLevel, severityLevelVariant, errorStatus } from '~/error_tracking/constants'; import ErrorDetails from '~/error_tracking/components/error_details.vue'; import Stacktrace from '~/error_tracking/components/stacktrace.vue'; import { diff --git a/spec/frontend/error_tracking/components/error_tracking_list_spec.js b/spec/frontend/error_tracking/components/error_tracking_list_spec.js index 59671c175e7..acc94b25ade 100644 --- a/spec/frontend/error_tracking/components/error_tracking_list_spec.js +++ b/spec/frontend/error_tracking/components/error_tracking_list_spec.js @@ -7,6 +7,7 @@ import ErrorTrackingActions from '~/error_tracking/components/error_tracking_act import ErrorTrackingList from '~/error_tracking/components/error_tracking_list.vue'; import { trackErrorListViewsOptions, trackErrorStatusUpdateOptions } from '~/error_tracking/utils'; import Tracking from '~/tracking'; +import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import errorsList from './list_mock.json'; Vue.use(Vuex); @@ -25,28 +26,33 @@ describe('ErrorTrackingList', () => { const findLoadingIcon = () => wrapper.find(GlLoadingIcon); const findPagination = () => wrapper.find(GlPagination); const findErrorActions = () => wrapper.find(ErrorTrackingActions); + const findIntegratedDisabledAlert = () => wrapper.findByTestId('integrated-disabled-alert'); function mountComponent({ errorTrackingEnabled = true, userCanEnableErrorTracking = true, + showIntegratedTrackingDisabledAlert = false, stubs = {}, } = {}) { - wrapper = mount(ErrorTrackingList, { - store, - propsData: { - indexPath: '/path', - listPath: '/error_tracking', - projectPath: 'project/test', - enableErrorTrackingLink: '/link', - userCanEnableErrorTracking, - errorTrackingEnabled, - illustrationPath: 'illustration/path', - }, - stubs: { - ...stubChildren(ErrorTrackingList), - ...stubs, - }, - }); + wrapper = extendedWrapper( + mount(ErrorTrackingList, { + store, + propsData: { + indexPath: '/path', + listPath: '/error_tracking', + projectPath: 'project/test', + enableErrorTrackingLink: '/link', + userCanEnableErrorTracking, + errorTrackingEnabled, + showIntegratedTrackingDisabledAlert, + illustrationPath: 'illustration/path', + }, + stubs: { + ...stubChildren(ErrorTrackingList), + ...stubs, + }, + }), + ); } beforeEach(() => { @@ -223,6 +229,31 @@ describe('ErrorTrackingList', () => { }); }); + describe('When the integrated tracking diabled alert should be shown', () => { + beforeEach(() => { + mountComponent({ + showIntegratedTrackingDisabledAlert: true, + stubs: { + GlAlert: false, + }, + }); + }); + + it('shows the alert box', () => { + expect(findIntegratedDisabledAlert().exists()).toBe(true); + }); + + describe('when alert is dismissed', () => { + it('hides the alert box', async () => { + findIntegratedDisabledAlert().vm.$emit('dismiss'); + + await nextTick(); + + expect(findIntegratedDisabledAlert().exists()).toBe(false); + }); + }); + }); + describe('When the ignore button on an error is clicked', () => { beforeEach(() => { store.state.list.loading = false; |