feat(short-drama-agent-front): 接入关系修复并优化配置与弹窗

This commit is contained in:
GJ committed 2026-10-31 22:37:22 +08:00
1 parent 2db8549818
commit 41d1cfe3ed
15 files changed
+1134 -323

No files matched your search

+26 -1
View File
@@ -513,7 +513,26 @@ describe('管理后台组件边界', () => {
expect(wrapper.find('.project-header .n-tag').exists()).toBe(false)
})
it('确认按钮有稳定根元素承接调用方间距,生产卡片用网格间距排列操作', () => {
it('公共弹窗状态仅在标题旁提示,默认不显示图标,切换状态不影响正文', async () => {
wrapper = mount(AppDialog, {
attachTo: document.body,
props: { open: true, title: '操作结果' },
slots: { default: '<p>请核对当前内容。</p>' }
})
await flushPromises()
expect(document.querySelector('.n-card-header [role="img"]')).toBeNull()
await wrapper.setProps({ status: 'warning' })
expect(document.querySelector('.n-card-header [aria-label="警告"]')).not.toBeNull()
await wrapper.setProps({ status: 'success' })
expect(document.querySelector('.n-card-header [aria-label="警告"]')).toBeNull()
expect(document.querySelector('.n-card-header [aria-label="成功"]')).not.toBeNull()
await wrapper.setProps({ status: 'error' })
expect(document.querySelector('.n-card-header [aria-label="成功"]')).toBeNull()
expect(document.querySelector('.n-card-header [aria-label="错误"]')).not.toBeNull()
expect(document.querySelector('.dialog-body-scroll')?.textContent).toContain('请核对当前内容。')
})
it('确认按钮有稳定根元素,操作说明始终位于正文,标题说明可省略', async () => {
wrapper = mount(ConfirmAction, {
props: { label: '测试操作', description: '仅展示,不提交请求' },
attrs: { class: 'mt-4' }
@@ -522,6 +541,12 @@ describe('管理后台组件边界', () => {
expect(wrapper.classes()).toContain('confirm-action')
expect(wrapper.classes()).toContain('mt-4')
expect(wrapper.get('button').text()).toBe('测试操作')
await wrapper.get('button').trigger('click')
await flushPromises()
const dialog = document.querySelector('.app-dialog')!
expect(dialog.querySelector('.n-card-header [aria-label="警告"]')).not.toBeNull()
expect(dialog.querySelector('.n-card-header')?.textContent).not.toContain('仅展示,不提交请求')
expect(dialog.querySelector('.dialog-body-scroll')?.textContent).toContain('仅展示,不提交请求')
expect(readAllStyles()).toMatch(/\.production-pipeline-card\s*\{[^}]*display:\s*grid;[^}]*gap:\s*16px;/)
})
})