From 001651027bfeeea18c44f997f13ec0124db4f3ab Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Sat, 11 Feb 2023 16:27:25 +0100 Subject: [PATCH] test: add repro for #1973 --- tests/components/DefinePropsAndDefineEmits.vue | 15 +++++++++++++++ tests/mount.spec.ts | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/components/DefinePropsAndDefineEmits.vue diff --git a/tests/components/DefinePropsAndDefineEmits.vue b/tests/components/DefinePropsAndDefineEmits.vue new file mode 100644 index 000000000..93b1cf6ee --- /dev/null +++ b/tests/components/DefinePropsAndDefineEmits.vue @@ -0,0 +1,15 @@ + + + diff --git a/tests/mount.spec.ts b/tests/mount.spec.ts index 7c77d66c4..fa0916322 100644 --- a/tests/mount.spec.ts +++ b/tests/mount.spec.ts @@ -1,6 +1,7 @@ import { describe, expect, it, vi } from 'vitest' import { defineComponent } from 'vue' import { mount } from '../src' +import DefinePropsAndDefineEmits from './components/DefinePropsAndDefineEmits.vue' import HelloFromVitestPlayground from './components/HelloFromVitestPlayground.vue' describe('mount: general tests', () => { @@ -32,4 +33,15 @@ describe('mount: general tests', () => { expect(spy).not.toHaveBeenCalled() }) + + it('should mount a component with props, emits and slot (#1973)', () => { + const wrapper = mount(DefinePropsAndDefineEmits, { + props: { + placement: 'end' + }, + slots: { default: 'Hello' } + }) + expect(wrapper.get('div').text()).toContain('Hello') + expect(wrapper.get('div').classes()).toContain('end') + }) })