mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
test(components): [select] fix test warning (#18211)
This commit is contained in:
parent
7633b1f7e9
commit
271385f6a5
@ -2,6 +2,7 @@ import { defineComponent, nextTick } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { afterEach, describe, it } from 'vitest'
|
||||
import Options from '../src/options'
|
||||
import Select from '../src/select.vue'
|
||||
|
||||
import type { PropType } from 'vue'
|
||||
import type { VueWrapper } from '@vue/test-utils'
|
||||
@ -33,15 +34,22 @@ describe('options', () => {
|
||||
const samples = Array.from({ length: 3 })
|
||||
|
||||
const createWrapper = (slots = {}) => {
|
||||
wrapper = mount((_, { slots }) => <Options>{slots?.default?.()}</Options>, {
|
||||
global: {
|
||||
components: {
|
||||
ElOption: ElOptionStub,
|
||||
ElOptionGroup: ElOptionGroupStub,
|
||||
wrapper = mount(
|
||||
(_, { slots }) => (
|
||||
<Select>
|
||||
<Options>{slots?.default?.()}</Options>
|
||||
</Select>
|
||||
),
|
||||
{
|
||||
global: {
|
||||
components: {
|
||||
ElOption: ElOptionStub,
|
||||
ElOptionGroup: ElOptionGroupStub,
|
||||
},
|
||||
},
|
||||
},
|
||||
slots,
|
||||
}) as VueWrapper<any>
|
||||
slots,
|
||||
}
|
||||
) as VueWrapper<any>
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -2718,7 +2718,6 @@ describe('Select', () => {
|
||||
>
|
||||
<el-option value="1">1</el-option>
|
||||
<el-option value="2">2</el-option>
|
||||
</el-option>
|
||||
</el-select>
|
||||
`,
|
||||
() => ({
|
||||
|
Loading…
Reference in New Issue
Block a user