diff --git a/packages/toast/index.js b/packages/toast/index.js index debdd299f..8f4f5c03d 100644 --- a/packages/toast/index.js +++ b/packages/toast/index.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import VueToast from './Toast'; -import { isObj, isServer, isInDocument } from '../utils'; +import { isObj, isServer } from '../utils'; const defaultOptions = { type: 'text', @@ -28,7 +28,7 @@ function createInstance() { return {}; } - if (!queue.length || multiple || !isInDocument(queue[0].$el)) { + if (!queue.length || multiple) { const toast = new (Vue.extend(VueToast))({ el: document.createElement('div') }); diff --git a/packages/toast/test/index.spec.js b/packages/toast/test/index.spec.js index d2bc734c1..45aaeb25e 100644 --- a/packages/toast/test/index.spec.js +++ b/packages/toast/test/index.spec.js @@ -1,4 +1,6 @@ +import Vue from 'vue'; import Toast from '..'; +import ToastVue from '../Toast'; import { transitionStub, later } from '../../../test/utils'; transitionStub(); @@ -86,3 +88,8 @@ test('onClose callback', () => { Toast.allowMultiple(false); expect(onClose).toHaveBeenCalledTimes(1); }); + +test('register component', () => { + Vue.use(Toast); + expect(Vue.component(ToastVue.name)).toBeTruthy(); +});