summaryrefslogtreecommitdiff
path: root/spec/frontend/tooltips
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
commitb76ae638462ab0f673e5915986070518dd3f9ad3 (patch)
treebdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/frontend/tooltips
parent434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff)
downloadgitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/frontend/tooltips')
-rw-r--r--spec/frontend/tooltips/components/tooltips_spec.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/frontend/tooltips/components/tooltips_spec.js b/spec/frontend/tooltips/components/tooltips_spec.js
index c44918ceaf3..9b703b74a1a 100644
--- a/spec/frontend/tooltips/components/tooltips_spec.js
+++ b/spec/frontend/tooltips/components/tooltips_spec.js
@@ -4,7 +4,7 @@ import { useMockMutationObserver } from 'helpers/mock_dom_observer';
import Tooltips from '~/tooltips/components/tooltips.vue';
describe('tooltips/components/tooltips.vue', () => {
- const { trigger: triggerMutate, observersCount } = useMockMutationObserver();
+ const { trigger: triggerMutate } = useMockMutationObserver();
let wrapper;
const buildWrapper = () => {
@@ -211,11 +211,14 @@ describe('tooltips/components/tooltips.vue', () => {
it('disconnects mutation observer on beforeDestroy', () => {
buildWrapper();
wrapper.vm.addTooltips([createTooltipTarget()]);
+ const { observer } = wrapper.vm;
+ jest.spyOn(observer, 'disconnect');
- expect(observersCount()).toBe(1);
+ expect(observer.disconnect).toHaveBeenCalledTimes(0);
wrapper.destroy();
- expect(observersCount()).toBe(0);
+
+ expect(observer.disconnect).toHaveBeenCalledTimes(1);
});
it('exposes hidden event', async () => {