发布:将已验 TEST 功能更新至既有生产灰度(2026-10-23) #21
@@ -1,5 +1,5 @@
|
||||
import ElementPlus from 'element-plus'
|
||||
import { enableAutoUnmount, flushPromises, mount, type VueWrapper } from '@vue/test-utils'
|
||||
import { DOMWrapper, enableAutoUnmount, flushPromises, mount, type VueWrapper } from '@vue/test-utils'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import DispatchWorkflowDialog from './DispatchWorkflowDialog.vue'
|
||||
import DispatchArrangeFields from './DispatchArrangeFields.vue'
|
||||
@@ -190,9 +190,11 @@ describe('dispatch workflow native layout', () => {
|
||||
await files.findAll('button').find(button => button.text() === '预览')!.trigger('click'); await flushPromises()
|
||||
const image = files.findComponent(AppDialog)
|
||||
expect(image.props('modelValue')).toBe(true)
|
||||
expect(image.get('img').attributes('src')).toBe('blob:owned-dispatch')
|
||||
await image.get('button[aria-label="展开全屏"]').trigger('click'); await flushPromises()
|
||||
await image.findAll('button').find(button => button.text() === '关闭')!.trigger('click'); await flushPromises()
|
||||
const preview = new DOMWrapper(document.querySelector('[aria-label="本车附件预览信息"]')!.closest('.el-dialog')!)
|
||||
expect(preview.get('img').attributes('src')).toBe('blob:owned-dispatch')
|
||||
await preview.get('button[aria-label="展开全屏"]').trigger('click'); await flushPromises()
|
||||
expect(preview.classes()).toContain('is-fullscreen')
|
||||
await preview.findAll('button').find(button => button.text() === '关闭')!.trigger('click'); await flushPromises()
|
||||
expect(URL.revokeObjectURL).toHaveBeenCalledWith('blob:owned-dispatch')
|
||||
const input = files.get('input[type="file"]'), file = new File(['png'], 'new.png', { type: 'image/png' })
|
||||
Object.defineProperty(input.element, 'files', { configurable: true, value: [file] }); await input.trigger('change'); await flushPromises()
|
||||
|
||||
@@ -164,7 +164,7 @@ describe('LocationsView', () => {
|
||||
expect(locationsSource).not.toContain('AppDrawer')
|
||||
expect(locationsSource).not.toContain('FormSection')
|
||||
expect(locationsSource).toContain('width="min(1000px, calc(100vw - 28px))"')
|
||||
expect(densitySource).toContain('.admin-density-dialog.el-dialog .el-dialog__body { min-height: 0; overflow-y: auto;')
|
||||
expect(densitySource).toContain('.admin-density-dialog.el-dialog > .el-dialog__body { flex: 1 1 auto; min-height: 0; overflow-y: auto;')
|
||||
expect(locationsSource).toContain('.editor-field-grid { grid-template-columns: minmax(0, 1fr); }')
|
||||
})
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -132,7 +132,7 @@ describe('PalletsView', () => {
|
||||
expect(palletsSource).not.toContain('<AppDrawer')
|
||||
expect(palletsSource).toContain('width="min(560px, calc(100vw - 28px))" class="pallet-editor-dialog admin-density-dialog admin-workbench is-dialog"')
|
||||
expect(palletsSource).not.toContain('<el-drawer v-model="editorOpen"')
|
||||
expect(densitySource).toContain('.admin-density-dialog.el-dialog .el-dialog__body { min-height: 0; overflow-y: auto;')
|
||||
expect(densitySource).toContain('.admin-density-dialog.el-dialog > .el-dialog__body { flex: 1 1 auto; min-height: 0; overflow-y: auto;')
|
||||
expect(palletsSource).toContain('.editor-field-grid { grid-template-columns: minmax(0, 1fr); }')
|
||||
})
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user