fix(hooks): [use-form-item] fix type error (#8726)

This commit is contained in:
zz 2022-07-09 16:49:07 +08:00 committed by GitHub
parent b0d654c992
commit 58bbef942a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,3 @@
// @ts-nocheck
import { defineComponent, provide } from 'vue'
import { NOOP } from '@vue/shared'
import { mount } from '@vue/test-utils'
@ -10,11 +9,7 @@ import {
formItemContextKey,
} from '@element-plus/tokens'
import type {
ButtonGroupContext,
FormContext,
FormItemContext,
} from '@element-plus/tokens'
import type { FormContext, FormItemContext } from '@element-plus/tokens'
const AXIOM = 'Rem is the best girl'
@ -39,7 +34,9 @@ describe('use-form-item', () => {
const propSize = 'small'
const wrapper = mountComponent(
() => {
provide(formItemContextKey, { size: 'large' })
provide(formItemContextKey, {
size: 'large',
} as FormItemContext)
},
{
props: { size: propSize },
@ -54,7 +51,7 @@ describe('use-form-item', () => {
const wrapper = mountComponent(() => {
provide(buttonGroupContextKey, {
size: fallbackSize,
} as ButtonGroupContext)
})
provide(formItemContextKey, {
size: 'large',