summaryrefslogtreecommitdiff
path: root/spec/frontend/issue_show/components/app_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/issue_show/components/app_spec.js')
-rw-r--r--spec/frontend/issue_show/components/app_spec.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/spec/frontend/issue_show/components/app_spec.js b/spec/frontend/issue_show/components/app_spec.js
index d970fd349e7..f76f42cb9ae 100644
--- a/spec/frontend/issue_show/components/app_spec.js
+++ b/spec/frontend/issue_show/components/app_spec.js
@@ -2,6 +2,7 @@ import { GlIntersectionObserver } from '@gitlab/ui';
import { mount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import { TEST_HOST } from 'helpers/test_constants';
+import { useMockIntersectionObserver } from 'helpers/mock_dom_observer';
import axios from '~/lib/utils/axios_utils';
import { visitUrl } from '~/lib/utils/url_utility';
import '~/behaviors/markdown/render_gfm';
@@ -22,6 +23,8 @@ const zoomMeetingUrl = 'https://gitlab.zoom.us/j/95919234811';
const publishedIncidentUrl = 'https://status.com/';
describe('Issuable output', () => {
+ useMockIntersectionObserver();
+
let mock;
let realtimeRequestCount = 0;
let wrapper;
@@ -45,11 +48,6 @@ describe('Issuable output', () => {
</div>
`);
- window.IntersectionObserver = class {
- disconnect = jest.fn();
- observe = jest.fn();
- };
-
mock = new MockAdapter(axios);
mock
.onGet('/gitlab-org/gitlab-shell/-/issues/9/realtime_changes/realtime_changes')
@@ -84,7 +82,6 @@ describe('Issuable output', () => {
});
afterEach(() => {
- delete window.IntersectionObserver;
mock.restore();
realtimeRequestCount = 0;