From 0ecc720022dd792e8c7f7c07ddfd96a928b0c234 Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Wed, 14 Aug 2024 17:01:01 +0200 Subject: [PATCH] fix: adjust to new mount API --- ...ult-variants-provider-and-selector.spec.ts | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/x-components/src/components/result/__tests__/result-variants-provider-and-selector.spec.ts b/packages/x-components/src/components/result/__tests__/result-variants-provider-and-selector.spec.ts index 9a84f508d5..e57df0030f 100644 --- a/packages/x-components/src/components/result/__tests__/result-variants-provider-and-selector.spec.ts +++ b/packages/x-components/src/components/result/__tests__/result-variants-provider-and-selector.spec.ts @@ -1,6 +1,6 @@ import { mount } from '@vue/test-utils'; import { Result } from '@empathyco/x-types'; -import { nextTick } from 'vue'; +import { defineComponent, nextTick } from 'vue'; import { createResultStub } from '../../../__stubs__/index'; import { findTestDataById, getDataTestSelector, installNewXPlugin } from '../../../__tests__/utils'; import ResultVariantsProvider from '../result-variants-provider.vue'; @@ -35,23 +35,28 @@ const render = ({ result = {}, autoSelectDepth = Number.POSITIVE_INFINITY } = {}) => { - const wrapper = mount({ - global: { plugins: [installNewXPlugin()] }, + const resultComponent = defineComponent({ + components: { + ResultVariantsProvider, + ResultVariantSelector + }, + data() { + return { + result, + autoSelectDepth + }; + }, template: ` ${template} - `, - components: { - ResultVariantsProvider, - ResultVariantSelector - }, - data: () => ({ - result, - autoSelectDepth - }) + ` + }); + + const wrapper = mount(resultComponent, { + global: { plugins: [installNewXPlugin()] } }); return {