CN-1551 fix: 修复element-plus版本升级导致的单元测试用例报错的问题
This commit is contained in:
@@ -464,7 +464,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addApp (pageNo, val, show) {
|
addApp (pageNo, val, show, index) {
|
||||||
|
if (!index) {
|
||||||
|
index = '0'
|
||||||
|
}
|
||||||
this.showAddApp = true
|
this.showAddApp = true
|
||||||
const params = {
|
const params = {
|
||||||
startTime: getSecond(this.timeFilter.startTime),
|
startTime: getSecond(this.timeFilter.startTime),
|
||||||
@@ -484,7 +487,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
params.pageNo = 1
|
params.pageNo = 1
|
||||||
}
|
}
|
||||||
if (parseFloat(this.appTypeTab) === 0) {
|
if (parseFloat(index) === 0) {
|
||||||
params.type = 'overviewProvide'
|
params.type = 'overviewProvide'
|
||||||
axios.get(api.dict, { params: params }).then(response => {
|
axios.get(api.dict, { params: params }).then(response => {
|
||||||
const res = response.data
|
const res = response.data
|
||||||
@@ -508,7 +511,7 @@ export default {
|
|||||||
this.loading = false
|
this.loading = false
|
||||||
this.loadingBody = false
|
this.loadingBody = false
|
||||||
})
|
})
|
||||||
} else if (parseFloat(this.appTypeTab) === 1) {
|
} else if (parseFloat(index) === 1) {
|
||||||
params.type = 'overviewApp'
|
params.type = 'overviewApp'
|
||||||
axios.get(api.dict, { params: params }).then(response => {
|
axios.get(api.dict, { params: params }).then(response => {
|
||||||
const res = response.data
|
const res = response.data
|
||||||
@@ -547,10 +550,10 @@ export default {
|
|||||||
cancelApp () {
|
cancelApp () {
|
||||||
this.showAddApp = false
|
this.showAddApp = false
|
||||||
},
|
},
|
||||||
appTypeTabChange () {
|
appTypeTabChange (n) {
|
||||||
this.pageObj.pageNo = 1
|
this.pageObj.pageNo = 1
|
||||||
this.searcherApp = ''
|
this.searcherApp = ''
|
||||||
this.addApp()
|
this.addApp('', '', '', n.index)
|
||||||
this.loadingBody = true
|
this.loadingBody = true
|
||||||
window.addEventListener('scroll', this.scrollChange, true)
|
window.addEventListener('scroll', this.scrollChange, true)
|
||||||
this.timerScroll = setTimeout(() => {
|
this.timerScroll = setTimeout(() => {
|
||||||
|
|||||||
@@ -203,11 +203,16 @@ describe('单元测试demo', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 执行nextTick等待el-table渲染完成
|
// 执行nextTick等待el-table渲染完成
|
||||||
await wrapper.vm.$nextTick()
|
// await wrapper.vm.$nextTick()
|
||||||
const textNode = await wrapper.get('[test-id="name0"]')
|
await new Promise(resolve => setTimeout(async () => {
|
||||||
const textNode2 = await wrapper.get('[test-id="age1"]')
|
const textNode = await wrapper.get('[test-id="name0"]')
|
||||||
expect(textNode.text()).toBe('a')
|
const textNode2 = await wrapper.get('[test-id="age1"]')
|
||||||
expect(textNode2.text()).toBe('11')
|
await wrapper.vm.$nextTick(() => {
|
||||||
|
expect(textNode.text()).toBe('a')
|
||||||
|
expect(textNode2.text()).toBe('11')
|
||||||
|
})
|
||||||
|
resolve()
|
||||||
|
}, 200))
|
||||||
})
|
})
|
||||||
test('js方法--getNameByEventType', async () => {
|
test('js方法--getNameByEventType', async () => {
|
||||||
expect(getNameByEventType('http error')).toBe('http error ratio')
|
expect(getNameByEventType('http error')).toBe('http error ratio')
|
||||||
|
|||||||
Reference in New Issue
Block a user