Skip to content

Commit

Permalink
fix: adjust to new mount API
Browse files Browse the repository at this point in the history
  • Loading branch information
diegopf committed Aug 14, 2024
1 parent 914c266 commit 0ecc720
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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: `
<ResultVariantsProvider
:result="result"
:autoSelectDepth="autoSelectDepth"
#default="{ result: newResult }">
${template}
</ResultVariantsProvider>`,
components: {
ResultVariantsProvider,
ResultVariantSelector
},
data: () => ({
result,
autoSelectDepth
})
</ResultVariantsProvider>`
});

const wrapper = mount(resultComponent, {
global: { plugins: [installNewXPlugin()] }
});

return {
Expand Down

0 comments on commit 0ecc720

Please sign in to comment.