Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-30 15:12:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-30 15:12:36 +0300
commit4e8c8922da341914b9fd5570ec9ce7a29ffdfebd (patch)
treeed5f67e965b15221d0ca5e2ad84e600dd3a61dd7 /spec/frontend/integrations
parent5b80d465ae36e5f73ac974b20928aeac82634e20 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/integrations')
-rw-r--r--spec/frontend/integrations/overrides/components/integration_overrides_spec.js29
1 files changed, 18 insertions, 11 deletions
diff --git a/spec/frontend/integrations/overrides/components/integration_overrides_spec.js b/spec/frontend/integrations/overrides/components/integration_overrides_spec.js
index dbed236d7df..ae89d05cead 100644
--- a/spec/frontend/integrations/overrides/components/integration_overrides_spec.js
+++ b/spec/frontend/integrations/overrides/components/integration_overrides_spec.js
@@ -1,16 +1,14 @@
-import { GlTable, GlLink, GlPagination } from '@gitlab/ui';
+import { GlTable, GlLink, GlPagination, GlAlert } from '@gitlab/ui';
+import * as Sentry from '@sentry/browser';
import { shallowMount, mount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import waitForPromises from 'helpers/wait_for_promises';
import { DEFAULT_PER_PAGE } from '~/api';
-import createFlash from '~/flash';
import IntegrationOverrides from '~/integrations/overrides/components/integration_overrides.vue';
import axios from '~/lib/utils/axios_utils';
import httpStatus from '~/lib/utils/http_status';
import ProjectAvatar from '~/vue_shared/components/project_avatar.vue';
-jest.mock('~/flash');
-
const mockOverrides = Array(DEFAULT_PER_PAGE * 3)
.fill(1)
.map((_, index) => ({
@@ -62,6 +60,7 @@ describe('IntegrationOverrides', () => {
text: link.text(),
};
});
+ const findAlert = () => wrapper.findComponent(GlAlert);
describe('while loading', () => {
it('sets GlTable `busy` attribute to `true`', () => {
@@ -104,18 +103,26 @@ describe('IntegrationOverrides', () => {
describe('when request fails', () => {
beforeEach(async () => {
+ jest.spyOn(Sentry, 'captureException');
mockAxios.onGet(defaultProps.overridesPath).reply(httpStatus.INTERNAL_SERVER_ERROR);
+
createComponent();
await waitForPromises();
});
- it('calls createFlash', () => {
- expect(createFlash).toHaveBeenCalledTimes(1);
- expect(createFlash).toHaveBeenCalledWith({
- message: IntegrationOverrides.i18n.defaultErrorMessage,
- captureError: true,
- error: expect.any(Error),
- });
+ it('displays error alert', () => {
+ const alert = findAlert();
+ expect(alert.exists()).toBe(true);
+ expect(alert.text()).toBe(IntegrationOverrides.i18n.defaultErrorMessage);
+ });
+
+ it('hides overrides table', () => {
+ const table = findGlTable();
+ expect(table.exists()).toBe(false);
+ });
+
+ it('captures exception in Sentry', () => {
+ expect(Sentry.captureException).toHaveBeenCalledWith(expect.any(Error));
});
});