Skip to content

Icon warning when testing Tabs component with jest #3660

@ssnowicki

Description

@ssnowicki
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.0.0-rc.9

Environment

Vue 3.0.5, antdv 2.0.0-rc.9, jest 26.0.0

Reproduction link

http://localhost:3000

Steps to reproduce

When a vue component that uses a-tabs is mounted in a jest .spec.js, the console will throw a warning about default icons in the a-tabs component's icons.

What is expected?

No warning, tab icons work correctly.

What is actually happening?

It seems that the default icons for the tab component have not been updated to use the new icon syntax in antdv 2x.

console.warn
[Vue warn]: Invalid prop: type check failed for prop "icon". Expected Object, got String with value "".
at <IconBase class="" icon="" primaryColor=undefined ... >
at
at
at <ScrollableTabBarNode saveRef=fn getRef=fn centered=false ... >
at <TabBarRootNode saveRef=fn centered=false tabPosition="top" ... >
at <Anonymous children=fn >
at <ScrollableInkTabBar centered=false tabPosition="top" prefixCls="ant-tabs" ... >
at <TabBar key="tabBar" defaultActiveKey="2" hideAdd=false ... >
at <Tabs defaultActiveKey="2" hideAdd=false centered=false ... >
at
at
at

at warn (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:40:17)
at validateProp (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:1800:13)
at validateProps (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:1771:9)
at initProps (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:1504:9)
at setupComponent (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6335:5)
at mountComponent (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:4083:9)
at processComponent (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:4059:17)

console.error
Warning: [@ant-design/icons-vue] icon should be icon definiton, but got

at warn (node_modules/@ant-design/icons-vue/es/utils.js:11:13)
at warning (node_modules/@ant-design/icons-vue/es/utils.js:15:3)
at render (node_modules/@ant-design/icons-vue/es/components/IconBase.js:45:3)
at renderComponentRoot (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:718:19)
at fn (node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:4158:53)
at effect (node_modules/@vue/reactivity/dist/reactivity.cjs.js:46:24)
at Object.effect (node_modules/@vue/reactivity/dist/reactivity.cjs.js:21:9)


Ran into it during unit tests. Does not occur on the actual page.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions