ui: 默认展开内容折叠区
This commit is contained in:
@@ -37,8 +37,11 @@ describe('精简入口保留功能', () => {
|
||||
expect(wrapper.emitted('select')).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('补充说明默认不展开,键盘可聚焦的标题可查看原文', async () => {
|
||||
it('补充说明默认展开,键盘可聚焦的标题仍可手动收起和展开', async () => {
|
||||
wrapper = mount(DetailDisclosure, { props: { title: '规则说明' }, slots: { default: '完整规则仍然保留' } })
|
||||
expect(wrapper.text()).toContain('完整规则仍然保留')
|
||||
await wrapper.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).not.toContain('完整规则仍然保留')
|
||||
await wrapper.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
@@ -47,9 +50,7 @@ describe('精简入口保留功能', () => {
|
||||
|
||||
it('风格高级字段收起不丢失保存值,展开后仍可修改', async () => {
|
||||
wrapper = mount(StyleEditor, { props: { visualStyle: null, disabled: false } })
|
||||
expect(wrapper.find('#style-constraints').exists()).toBe(false)
|
||||
await wrapper.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
expect(wrapper.find('#style-constraints').exists()).toBe(true)
|
||||
await wrapper.get('#style-constraints').setValue('["保留硬约束"]')
|
||||
const fields = wrapper.findAllComponents(NInput)
|
||||
fields.find(item => item.props('placeholder')?.includes('人物质感'))!.vm.$emit('update:value', '人物风格')
|
||||
|
||||
@@ -93,8 +93,7 @@ describe('统一的 Naive UI 表单校验', () => {
|
||||
it('折叠后的非法 JSON 仍拦截保存并展开错误,修正后保留草稿正常提交', async () => {
|
||||
wrapper = mount(StyleEditor, { attachTo: document.body, props: { visualStyle: null, disabled: false } })
|
||||
await flushPromises()
|
||||
button('分类风格与硬约束').click()
|
||||
await flushPromises()
|
||||
expect(button('分类风格与硬约束').getAttribute('aria-expanded')).toBe('true')
|
||||
await input('#style-name', '手工风格')
|
||||
await input('#style-constraints', '{"invalid":true}')
|
||||
button('分类风格与硬约束').click()
|
||||
|
||||
Reference in New Issue
Block a user