mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-09 02:31:33 +08:00
fix flaky select test case (#391)
* chore(core): fix linting * fix(message): fix test * fix(message): fix message test * fix(select): remove unused * fix(select): fix concurrent select test case
This commit is contained in:
parent
62fe4c14f7
commit
b5f08aa63a
@ -28,7 +28,9 @@ const _mount = (template: string, data: any = () => ({}), otherObj?): any => mou
|
||||
})
|
||||
|
||||
function getOptions(): HTMLElement[] {
|
||||
return document.querySelectorAll('.el-popper__mask:last-child .el-select-dropdown__item') as any
|
||||
return [...document.querySelectorAll<HTMLElement>(
|
||||
'.el-popper__mask:last-child .el-select-dropdown__item',
|
||||
)]
|
||||
}
|
||||
|
||||
const getSelectVm = (configs: SelectProps = {}, options?) => {
|
||||
@ -296,9 +298,9 @@ describe('Select', () => {
|
||||
selectVm.selectedLabel = 'new'
|
||||
selectVm.debouncedOnInputChange()
|
||||
await selectVm.$nextTick()
|
||||
const options = wrapper.findComponent({ name: 'ElSelect' }).findComponent({ ref: 'popper' }).findAll('.el-select-dropdown__item span')
|
||||
const target = options.filter(option => option.text() === 'new')
|
||||
await target[0].trigger('click')
|
||||
const options = [...getOptions()]
|
||||
const target = options.filter(option => option.textContent === 'new')
|
||||
target[0].click()
|
||||
expect((wrapper.vm as any).value).toBe('new')
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user