This commit is contained in:
2026-10-21 16:40:10 +08:00
parent 8356e98ce3
commit e2f99b4f4b
18 changed files with 391 additions and 52 deletions
+21 -2
View File
@@ -835,7 +835,7 @@ describe('approved Admin density ownership', () => {
it('keeps contained overseas tab content and external cargo tab bodies separate', () => {
expect(shared).toContain('.density-element-tabs:not(.density-contained-tabs) > .el-tabs__content { display: none; }')
for (const file of ['LastMileOrderDetailView', 'DeliveryOrderDetailView']) {
for (const file of ['LastMileOrderDetailView', 'DeliveryOrderDetailView', 'DispatchDetailView']) {
const source = read('modules/overseas-warehouse/pages/' + file + '.vue')
const ast = parse(source).descriptor.template!.ast!
let panes = 0
@@ -854,6 +854,24 @@ describe('approved Admin density ownership', () => {
}
})
it('fits the five dispatch vehicle fields in one desktop row and keeps actions below the tabs', () => {
const source = read('modules/overseas-warehouse/pages/DispatchDetailView.vue')
const css = parse(source).descriptor.styles.map(style => style.content).join('\n')
const declarations = (source: string, selector: string) => {
const values: Record<string, string> = {}
cssRoot(source).walkRules(rule => {
if (rule.selector === selector && rule.parent?.type !== 'atrule') rule.walkDecls(decl => { values[decl.prop] = decl.value })
})
return values
}
expect(declarations(css, '.dispatch-detail .vehicle-fields')['grid-template-columns']).toBe('minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(0, 0.8fr)')
expect(declarations(css, '.dispatch-detail .vehicle-fields > div')['grid-template-columns']).toBe('max-content minmax(0, 1fr)')
expect(declarations(css, '.dispatch-actions')['justify-content']).toBe('flex-end')
expect(declarations(shared, '.admin-density .density-contained-tabs > .el-tabs__content').padding).toBe('var(--admin-space-5)')
expect(declarations(shared, '.admin-density .density-contained-tabs.density-contained-tabs--flush > .el-tabs__content').padding).toBe('0')
expect(elementsOf(source, 'el-tabs').every(node => classesOf(node).includes('density-contained-tabs--flush'))).toBe(true)
})
it('opts shared overseas detail and relationship wrappers in only at approved callers', () => {
for (const file of ['modules/overseas-warehouse/components/OverseasDetailShell.vue', 'modules/overseas-warehouse/components/OverseasReadOnlyDetail.vue', 'shared/components/InboundCodeRelationshipDialog.vue']) {
const source = read(file)
@@ -1301,7 +1319,8 @@ describe('approved Admin density ownership', () => {
expect(source).not.toContain('class="density-dialog-section dispatch-draft-toolbar"')
expect(source).toContain('<template #vehicle-controls>')
expect(source).toContain('class="density-form dispatch-setup-fields"')
expect(source).toContain('class="dispatch-warehouse-picker" aria-label="起运仓"')
expect(source).toContain('<el-form-item v-if="mode === \'empty\'" label="起运仓">')
expect(source).toContain('<template #order-controls>')
expect(source).not.toContain('class="dispatch-warehouse-field" label="起运仓"')
expect(source).not.toContain('data-tone="work"')
expect(source).not.toContain('data-tone="summary"')