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:
Diffstat (limited to 'spec/frontend/vue_shared/plugins/global_toast_spec.js')
-rw-r--r--spec/frontend/vue_shared/plugins/global_toast_spec.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/frontend/vue_shared/plugins/global_toast_spec.js b/spec/frontend/vue_shared/plugins/global_toast_spec.js
index 551abe3cb41..89f43a5e556 100644
--- a/spec/frontend/vue_shared/plugins/global_toast_spec.js
+++ b/spec/frontend/vue_shared/plugins/global_toast_spec.js
@@ -1,24 +1,24 @@
-import toast from '~/vue_shared/plugins/global_toast';
import Vue from 'vue';
+import toast from '~/vue_shared/plugins/global_toast';
describe('Global toast', () => {
let spyFunc;
beforeEach(() => {
- spyFunc = jest.spyOn(Vue.toasted, 'show').mockImplementation(() => {});
+ spyFunc = jest.spyOn(Vue.prototype.$toast, 'show').mockImplementation(() => {});
});
afterEach(() => {
spyFunc.mockRestore();
});
- it('should pass all args to Vue toasted', () => {
+ it("should call GitLab UI's toast method", () => {
const arg1 = 'TestMessage';
const arg2 = { className: 'foo' };
toast(arg1, arg2);
- expect(Vue.toasted.show).toHaveBeenCalledTimes(1);
- expect(Vue.toasted.show).toHaveBeenCalledWith(arg1, arg2);
+ expect(Vue.prototype.$toast.show).toHaveBeenCalledTimes(1);
+ expect(Vue.prototype.$toast.show).toHaveBeenCalledWith(arg1, arg2);
});
});