diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 09:10:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 09:10:16 +0000 |
commit | 2c49951e8c1f4fb95d15cac3dd0677d6882d2add (patch) | |
tree | acca123398daa394dd9810ac47ac07319c53e9a9 /spec/frontend/alert_management | |
parent | fb553bbc1899eddaddb07cd9685cdabffbed9962 (diff) | |
download | gitlab-ce-2c49951e8c1f4fb95d15cac3dd0677d6882d2add.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/alert_management')
-rw-r--r-- | spec/frontend/alert_management/components/alert_metrics_spec.js | 9 | ||||
-rw-r--r-- | spec/frontend/alert_management/components/sidebar/alert_managment_sidebar_assignees_spec.js | 17 |
2 files changed, 12 insertions, 14 deletions
diff --git a/spec/frontend/alert_management/components/alert_metrics_spec.js b/spec/frontend/alert_management/components/alert_metrics_spec.js index e0a069fa1a8..42da8c3768b 100644 --- a/spec/frontend/alert_management/components/alert_metrics_spec.js +++ b/spec/frontend/alert_management/components/alert_metrics_spec.js @@ -3,15 +3,13 @@ import waitForPromises from 'helpers/wait_for_promises'; import MockAdapter from 'axios-mock-adapter'; import axios from 'axios'; import AlertMetrics from '~/alert_management/components/alert_metrics.vue'; +import MetricEmbed from '~/monitoring/components/embeds/metric_embed.vue'; jest.mock('~/monitoring/stores', () => ({ monitoringDashboard: {}, })); -const mockEmbedName = 'MetricsEmbedStub'; - jest.mock('~/monitoring/components/embeds/metric_embed.vue', () => ({ - name: mockEmbedName, render(h) { return h('div'); }, @@ -26,13 +24,10 @@ describe('Alert Metrics', () => { propsData: { ...props, }, - stubs: { - MetricEmbed: true, - }, }); } - const findChart = () => wrapper.find({ name: mockEmbedName }); + const findChart = () => wrapper.find(MetricEmbed); const findEmptyState = () => wrapper.find({ ref: 'emptyState' }); afterEach(() => { diff --git a/spec/frontend/alert_management/components/sidebar/alert_managment_sidebar_assignees_spec.js b/spec/frontend/alert_management/components/sidebar/alert_managment_sidebar_assignees_spec.js index a14596b6722..3dd8b35d196 100644 --- a/spec/frontend/alert_management/components/sidebar/alert_managment_sidebar_assignees_spec.js +++ b/spec/frontend/alert_management/components/sidebar/alert_managment_sidebar_assignees_spec.js @@ -125,7 +125,7 @@ describe('Alert Details Sidebar Assignees', () => { }); }); - it('shows an error when request contains error messages', () => { + it('emits an error when request contains error messages', () => { wrapper.setData({ isDropdownSearching: false }); const errorMutationResult = { data: { @@ -137,12 +137,15 @@ describe('Alert Details Sidebar Assignees', () => { }; jest.spyOn(wrapper.vm.$apollo, 'mutate').mockResolvedValue(errorMutationResult); - - return wrapper.vm.$nextTick().then(() => { - const SideBarAssigneeItem = wrapper.findAll(SidebarAssignee).at(0); - SideBarAssigneeItem.vm.$emit('click'); - expect(wrapper.emitted('alert-refresh')).toBeUndefined(); - }); + return wrapper.vm + .$nextTick() + .then(() => { + const SideBarAssigneeItem = wrapper.findAll(SidebarAssignee).at(0); + SideBarAssigneeItem.vm.$emit('update-alert-assignees'); + }) + .then(() => { + expect(wrapper.emitted('alert-error')).toBeDefined(); + }); }); it('stops updating and cancels loading when the request fails', () => { |