mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
test(components): [cascader] update (#21329)
This commit is contained in:
@@ -124,6 +124,29 @@ const lazyLoad: LazyLoad = (node, resolve) => {
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
describe('avoid other test case affecting this test case', () => {
|
||||
test('check strictly in single mode with first option', async () => {
|
||||
// #21311
|
||||
const value = ref([])
|
||||
const props = {
|
||||
checkStrictly: true,
|
||||
}
|
||||
const wrapper = mount(() => (
|
||||
<CascaderPanel
|
||||
v-model={value.value}
|
||||
options={NORMAL_OPTIONS}
|
||||
props={props}
|
||||
/>
|
||||
))
|
||||
|
||||
const zjRadio = wrapper.findAll(RADIO)[0]
|
||||
expect(zjRadio.exists()).toBe(true)
|
||||
|
||||
await zjRadio.find('input').trigger('click')
|
||||
expect(value.value).toEqual(['beijing'])
|
||||
})
|
||||
})
|
||||
|
||||
describe('CascaderPanel.vue', () => {
|
||||
beforeEach(() => {
|
||||
id = 0
|
||||
@@ -430,27 +453,6 @@ describe('CascaderPanel.vue', () => {
|
||||
expect(value.value).toEqual(['zhejiang'])
|
||||
})
|
||||
|
||||
test('check strictly in single mode with first option', async () => {
|
||||
// #21311
|
||||
const value = ref([])
|
||||
const props = {
|
||||
checkStrictly: true,
|
||||
}
|
||||
const wrapper = mount(() => (
|
||||
<CascaderPanel
|
||||
v-model={value.value}
|
||||
options={NORMAL_OPTIONS}
|
||||
props={props}
|
||||
/>
|
||||
))
|
||||
|
||||
const zjRadio = wrapper.findAll(RADIO)[0]
|
||||
expect(zjRadio.exists()).toBe(true)
|
||||
|
||||
await zjRadio.find('input').trigger('click')
|
||||
expect(value.value).toEqual(['beijing'])
|
||||
})
|
||||
|
||||
test('check strictly in single mode with disabled options', async () => {
|
||||
const props = {
|
||||
checkStrictly: true,
|
||||
|
||||
Reference in New Issue
Block a user