mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(ci): suppress warning by mark icon as raw (#6555)
This commit is contained in:
committed by
GitHub
parent
88b574e765
commit
14353dbfce
@@ -1,4 +1,4 @@
|
||||
import { nextTick } from 'vue'
|
||||
import { nextTick, markRaw } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { User } from '@element-plus/icons-vue'
|
||||
import {
|
||||
@@ -39,7 +39,7 @@ describe('Avatar.vue', () => {
|
||||
})
|
||||
|
||||
test('icon avatar', () => {
|
||||
const wrapper = _mount(() => <Avatar icon={User} />)
|
||||
const wrapper = _mount(() => <Avatar icon={markRaw(User)} />)
|
||||
expect(wrapper.classes()).toContain('el-avatar--icon')
|
||||
expect(wrapper.findComponent(User).exists()).toBe(true)
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ref, nextTick, defineComponent } from 'vue'
|
||||
import { ref, nextTick, defineComponent, markRaw } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { Loading, Search } from '@element-plus/icons-vue'
|
||||
import Button from '../src/button.vue'
|
||||
@@ -17,7 +17,7 @@ describe('Button.vue', () => {
|
||||
|
||||
it('icon', () => {
|
||||
const wrapper = mount(Button, {
|
||||
props: { icon: Search },
|
||||
props: { icon: markRaw(Search) },
|
||||
})
|
||||
expect(wrapper.findComponent(Search).exists()).toBeTruthy()
|
||||
})
|
||||
@@ -111,7 +111,7 @@ describe('Button.vue', () => {
|
||||
it('loading icon', () => {
|
||||
const wrapper = mount(Button, {
|
||||
props: {
|
||||
loadingIcon: Search,
|
||||
loadingIcon: markRaw(Search),
|
||||
loading: true,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { markRaw } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { ArrowLeft } from '@element-plus/icons-vue'
|
||||
import PageHeader from '../src/page-header.vue'
|
||||
@@ -13,7 +14,7 @@ describe('PageHeader.vue', () => {
|
||||
})
|
||||
|
||||
test('should render icon props', () => {
|
||||
const icon = ArrowLeft
|
||||
const icon = markRaw(ArrowLeft)
|
||||
const wrapper = mount(PageHeader, {
|
||||
props: { icon },
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { nextTick } from 'vue'
|
||||
import { nextTick, markRaw } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { Edit } from '@element-plus/icons-vue'
|
||||
import Steps from '../src/index.vue'
|
||||
@@ -13,7 +13,7 @@ const _mount = (template: string) =>
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
iconEdit: Edit,
|
||||
iconEdit: markRaw(Edit),
|
||||
}
|
||||
},
|
||||
template,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { nextTick } from 'vue'
|
||||
import { nextTick, markRaw } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { Checked, CircleClose } from '@element-plus/icons-vue'
|
||||
import Switch from '../src/switch.vue'
|
||||
@@ -55,8 +55,8 @@ describe('Switch.vue', () => {
|
||||
test('switch with icons', () => {
|
||||
const wrapper = mount(Switch, {
|
||||
props: {
|
||||
activeIcon: Checked,
|
||||
inactiveIcon: CircleClose,
|
||||
activeIcon: markRaw(Checked),
|
||||
inactiveIcon: markRaw(CircleClose),
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineComponent } from 'vue'
|
||||
import { defineComponent, markRaw } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { MoreFilled } from '@element-plus/icons-vue'
|
||||
import TimeLine from '../src/timeline'
|
||||
@@ -12,7 +12,7 @@ const Component = defineComponent({
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
iconMoreFilled: MoreFilled,
|
||||
iconMoreFilled: markRaw(MoreFilled),
|
||||
activities: [
|
||||
{
|
||||
content: 'Step 1: xxxxxx',
|
||||
|
||||
Reference in New Issue
Block a user