feat(ui): 工作台界面全部替换为element plus
This commit is contained in:
1 parent
26d213c05b
commit
d5f988a16c
38 files changed
+4501
-3087
No files matched your search
+13
-6
@@ -3,6 +3,7 @@
|
||||
* 用途:锁定人工上传确认弹窗无障碍与无凭据提交契约。
|
||||
* 依赖:vitest、@vue/test-utils、vue-i18n、shipping-tasks API mock。
|
||||
* 逻辑:打开时具备 dialog 角色;Escape 关闭;无需截图/PDF或回执即可确认;关闭后恢复先前焦点。
|
||||
* ElDialog 传送到 body,断言改查 document.body,业务结果不变。
|
||||
*/
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { mount, flushPromises } from '@vue/test-utils';
|
||||
@@ -59,9 +60,14 @@ describe('ManualUploadEvidenceDialog', () => {
|
||||
it('exposes dialog accessibility attributes when open', async () => {
|
||||
const wrapper = mountDialog(true);
|
||||
await nextTick();
|
||||
const dialog = wrapper.get('[data-testid="manual-upload-evidence-dialog"]');
|
||||
expect(dialog.attributes('role')).toBe('dialog');
|
||||
expect(dialog.attributes('aria-modal')).toBe('true');
|
||||
await flushPromises();
|
||||
const marked = document.body.querySelector('[data-testid="manual-upload-evidence-dialog"]');
|
||||
const dialog = marked?.getAttribute('role') === 'dialog'
|
||||
? marked
|
||||
: marked?.closest('[role="dialog"]') || document.body.querySelector('[role="dialog"]');
|
||||
expect(dialog?.getAttribute('role')).toBe('dialog');
|
||||
expect(dialog?.getAttribute('aria-modal')).toBe('true');
|
||||
expect(dialog?.textContent).toContain('登记人工上传');
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
@@ -92,10 +98,11 @@ describe('ManualUploadEvidenceDialog', () => {
|
||||
it('submits with business_no without file evidence or freight receipt', async () => {
|
||||
const wrapper = mountDialog(true);
|
||||
await nextTick();
|
||||
const submit = wrapper.findAll('button').find((btn) => btn.text().includes('确认已上传'));
|
||||
await flushPromises();
|
||||
const submit = Array.from(document.body.querySelectorAll('button')).find((btn) => btn.textContent?.includes('确认已上传'));
|
||||
expect(submit).toBeTruthy();
|
||||
expect(submit!.attributes('disabled')).toBeUndefined();
|
||||
await submit!.trigger('click');
|
||||
expect(submit!.hasAttribute('disabled')).toBe(false);
|
||||
submit!.click();
|
||||
await flushPromises();
|
||||
expect(wrapper.emitted('success')).toHaveLength(1);
|
||||
wrapper.unmount();
|
||||
|
||||
Reference in new issue
Block a user