fix(ci): suppress warning by mark icon as raw (#6555)

This commit is contained in:
Herrington Darkholme
2022-03-12 02:58:29 -05:00
committed by GitHub
parent 88b574e765
commit 14353dbfce
6 changed files with 14 additions and 13 deletions

View File

@@ -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)
})

View File

@@ -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,
},
})

View File

@@ -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 },
})

View File

@@ -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,

View File

@@ -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),
},
})

View File

@@ -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',