UI: fix ui test errors (#7030)

This commit is contained in:
Wei Zhou 2022-12-29 09:08:54 +01:00 committed by GitHub
parent ffccfc6172
commit dc40ea130f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 11 deletions

View File

@ -25,7 +25,7 @@ concurrency:
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

View File

@ -135,11 +135,11 @@
"testApiNameCase5": {
"params": [
{
"name": "column2",
"name": "column1",
"type": "string"
},
{
"name": "column1",
"name": "column2",
"type": "string"
},
{
@ -642,4 +642,4 @@
"component": {}
}
]
}
}

View File

@ -272,6 +272,7 @@ describe('Components > View > ActionButton.vue', () => {
}
}
})
wrapper.vm.hasOwnProperty = () => Object.hasOwnProperty;
const handleShowBadge = jest.spyOn(wrapper.vm, 'handleShowBadge')
await wrapper.setProps({ resource: null })
@ -286,6 +287,7 @@ describe('Components > View > ActionButton.vue', () => {
}
}
})
wrapper.vm.hasOwnProperty = () => Object.hasOwnProperty;
const handleShowBadge = jest.spyOn(wrapper.vm, 'handleShowBadge')
await wrapper.setProps({ resource: { id: null } })
@ -300,6 +302,7 @@ describe('Components > View > ActionButton.vue', () => {
}
}
})
wrapper.vm.hasOwnProperty = () => Object.hasOwnProperty;
const handleShowBadge = jest.spyOn(wrapper.vm, 'handleShowBadge')
await wrapper.setProps({
resource: {

View File

@ -1029,11 +1029,11 @@ describe('Views > AutogenView.vue', () => {
await flushPromises()
expect(wrapper.vm.currentAction.params).toEqual([
{ name: 'id', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'column1', type: 'string' },
{ name: 'column2', type: 'string' },
{ name: 'column3', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'id', type: 'string' }
{ name: 'column3', type: 'string' }
])
expect(wrapper.vm.currentAction.paramFields).toEqual([])
expect(wrapper.vm.showAction).toBeTruthy()
@ -1094,11 +1094,11 @@ describe('Views > AutogenView.vue', () => {
await flushPromises()
expect(wrapper.vm.currentAction.params).toEqual([
{ name: 'id', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'column1', type: 'string' },
{ name: 'column2', type: 'string' },
{ name: 'column3', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'id', type: 'string' }
{ name: 'column3', type: 'string' }
])
expect(wrapper.vm.currentAction.paramFields).toEqual([
{ name: 'id', type: 'string' },
@ -1821,7 +1821,7 @@ describe('Views > AutogenView.vue', () => {
expect(router.currentRoute.value.path).toEqual('/guestnetwork')
expect(router.currentRoute.value.query).toEqual({
filter: 'filter',
type: 'filter',
networkfilter: 'filter',
page: '1',
pagesize: '20'
})