diff --git a/packages/x-components/src/wiring/__tests__/operators-testing-utils.ts b/packages/x-components/src/wiring/__tests__/operators-testing-utils.ts index 96eebfabb3..b3402d43c3 100644 --- a/packages/x-components/src/wiring/__tests__/operators-testing-utils.ts +++ b/packages/x-components/src/wiring/__tests__/operators-testing-utils.ts @@ -1,6 +1,6 @@ import { DeepPartial } from '@empathyco/x-utils'; -import { createLocalVue } from '@vue/test-utils'; -import Vuex, { Store } from 'vuex'; +import { mount } from '@vue/test-utils'; +import { createStore, Store } from 'vuex'; import { EventPayload, SubjectPayload, XBus } from '@empathyco/x-bus'; import { Observable } from 'rxjs'; import { RootXStoreState } from '../../store/index'; @@ -19,16 +19,15 @@ export function createWire({ event = 'UserIsTypingAQuery' as SomeEvent, state }: CreateWireOptions = {}): CreateWireAPI> { - const vue = createLocalVue(); - vue.use(Vuex); + const store = createStore({ + state: { x: state } + }) as Store; + mount({}, { global: { plugins: [store] } }); const bus = new XDummyBus(); const callback = jest.fn(); const wire = createWireFromFunction>(({ eventPayload }) => { callback(eventPayload); }); - const store = new Store>({ - state: { x: state } - }) as Store; return { store, diff --git a/packages/x-components/src/wiring/__tests__/utils.ts b/packages/x-components/src/wiring/__tests__/utils.ts index 2879e97cd6..dcff1126e0 100644 --- a/packages/x-components/src/wiring/__tests__/utils.ts +++ b/packages/x-components/src/wiring/__tests__/utils.ts @@ -1,6 +1,6 @@ -import { createLocalVue } from '@vue/test-utils'; +import { mount } from '@vue/test-utils'; import { Subject } from 'rxjs'; -import Vuex, { Store } from 'vuex'; +import { createStore, Store } from 'vuex'; import { RootXStoreState } from '../../store/store.types'; import { XModuleName } from '../../x-modules/x-modules.types'; import { WireParams, WirePayload } from '../wiring.types'; @@ -13,9 +13,7 @@ import { WireParams, WirePayload } from '../wiring.types'; * @internal */ export function createQuerySuggestionsStoreMock(): Store { - const localVue = createLocalVue(); - localVue.use(Vuex); - const store = new Store({ + const store = createStore({ state: () => ({ x: { querySuggestions: { @@ -31,6 +29,7 @@ export function createQuerySuggestionsStoreMock(): Store { state.x.querySuggestions.query.trim() } }); + mount({}, { global: { plugins: [store] } }); store.commit = jest.fn(); store.dispatch = jest.fn(); return store;