From e8d2c2579383897a1dd7f9debd359abe8ae8373d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 20 Jul 2021 09:55:51 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-1-stable-ee --- spec/frontend/vue_shared/plugins/global_toast_spec.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'spec/frontend/vue_shared/plugins') diff --git a/spec/frontend/vue_shared/plugins/global_toast_spec.js b/spec/frontend/vue_shared/plugins/global_toast_spec.js index 89f43a5e556..322586a772c 100644 --- a/spec/frontend/vue_shared/plugins/global_toast_spec.js +++ b/spec/frontend/vue_shared/plugins/global_toast_spec.js @@ -1,11 +1,10 @@ -import Vue from 'vue'; -import toast from '~/vue_shared/plugins/global_toast'; +import toast, { instance } from '~/vue_shared/plugins/global_toast'; describe('Global toast', () => { let spyFunc; beforeEach(() => { - spyFunc = jest.spyOn(Vue.prototype.$toast, 'show').mockImplementation(() => {}); + spyFunc = jest.spyOn(instance.$toast, 'show').mockImplementation(() => {}); }); afterEach(() => { @@ -18,7 +17,7 @@ describe('Global toast', () => { toast(arg1, arg2); - expect(Vue.prototype.$toast.show).toHaveBeenCalledTimes(1); - expect(Vue.prototype.$toast.show).toHaveBeenCalledWith(arg1, arg2); + expect(instance.$toast.show).toHaveBeenCalledTimes(1); + expect(instance.$toast.show).toHaveBeenCalledWith(arg1, arg2); }); }); -- cgit v1.2.3