优化
This commit is contained in:
@@ -18,7 +18,7 @@ test('activates all three customer cross-border pages with frozen permissions',
|
||||
assert.match(view, /merchant:cross-border:procurement:create/)
|
||||
assert.match(view, /merchant:cross-border:domestic-trucking:create/)
|
||||
assert.match(view, /merchant:cross-border:pallet-shipping:create/)
|
||||
assert.match(view, /v-else-if="canCreate"/)
|
||||
assert.match(view, /v-if="canCreate"[^>]*type="primary"/)
|
||||
})
|
||||
|
||||
test('uses only merchant overseas endpoints and keeps retry idempotency stable', () => {
|
||||
@@ -36,10 +36,12 @@ test('covers list detail create loading error empty pagination and actions-first
|
||||
assert.match(view, /mode\.value = 'list'/)
|
||||
assert.match(view, /mode = 'create'/)
|
||||
assert.match(view, /v-loading="loading"/)
|
||||
assert.match(view, /type="error"/)
|
||||
assert.match(view, /class="business-load-error"/)
|
||||
assert.match(view, /empty-text="暂无订单"/)
|
||||
assert.match(view, /<el-pagination/)
|
||||
assert.match(view, /<el-table-column label="操作"[^>]*fixed="left"/)
|
||||
assert.match(view, /<QueryToolbar[^>]*layout="grid"/)
|
||||
assert.match(view, /<DataTable[^>]*:row-actions="getRowActions"/)
|
||||
assert.match(view, /key: 'actions', label: '操作', width: 90, fixed: 'left'/)
|
||||
assert.match(view, /class="business-table-card"/)
|
||||
assert.match(view, /PENDING_OUTBOUND: '待出库'/)
|
||||
assert.match(view, /PARTIALLY_OUTBOUND: '部分出库'/)
|
||||
assert.match(view, /OUTBOUNDED: '全部出库'/)
|
||||
@@ -47,10 +49,41 @@ test('covers list detail create loading error empty pagination and actions-first
|
||||
assert.match(view, /\['审核备注', current\.reviewRemark\]/)
|
||||
})
|
||||
|
||||
test('opens every dashboard cross-border action on a dedicated protected create page', () => {
|
||||
for (const [path, permission] of [
|
||||
['cross-border/procurement/create', 'merchant:cross-border:procurement:create'],
|
||||
['cross-border/domestic-trucking/create', 'merchant:cross-border:domestic-trucking:create'],
|
||||
['cross-border/pallet-shipping/create', 'merchant:cross-border:pallet-shipping:create'],
|
||||
]) {
|
||||
assert.match(routes, new RegExp(`path: '${path}'[\\s\\S]*?props: \\{ createPage: true \\}[\\s\\S]*?permission: '${permission}'`))
|
||||
}
|
||||
assert.match(view, /props\.createPage \? 'create' : 'list'/)
|
||||
assert.match(view, /if \(props\.createPage\) await router\.push/)
|
||||
})
|
||||
|
||||
test('opens all cross-border details on dedicated protected routes', () => {
|
||||
for (const [path, routeName] of [
|
||||
['cross-border/procurement/:orderNo/detail', 'cross-border-procurement-detail'],
|
||||
['cross-border/domestic-trucking/:orderNo/detail', 'cross-border-domestic-trucking-detail'],
|
||||
['cross-border/pallet-shipping/:orderNo/detail', 'cross-border-pallet-shipping-detail'],
|
||||
]) {
|
||||
assert.match(routes, new RegExp(`path: '${path.replaceAll('/', '\\/')}'[\\s\\S]*?name: '${routeName}'`))
|
||||
}
|
||||
assert.match(view, /name: detailRouteName\.value, params: \{ orderNo: row\.orderNo \}/)
|
||||
assert.match(view, /class="business-detail-error"/)
|
||||
})
|
||||
|
||||
test('keeps procurement filters, details and forms readable at PDA width', () => {
|
||||
assert.match(view, /@media \(max-width: 767px\)/)
|
||||
assert.match(view, /\.filter-card :deep\(\.el-form\) \{ display: grid; grid-template-columns: 1fr; \}/)
|
||||
assert.match(view, /queryFields/)
|
||||
assert.match(view, /\.detail-grid \{ grid-template-columns: 1fr; \}/)
|
||||
assert.match(view, /\.form-card :deep\(\.el-form-item\) \{ display: block; \}/)
|
||||
assert.match(view, /\.budget-form-item :deep\(\.el-form-item__content\) \{ display: flex; flex-wrap: nowrap; \}/)
|
||||
})
|
||||
|
||||
test('uses the shared dense order-list and detail visual language', () => {
|
||||
assert.match(view, /class="business-orders client-ui"/)
|
||||
assert.match(view, /\.business-detail-page \{[^}]*border: 1px solid var\(--client-border\);[^}]*border-radius: var\(--client-radius\);/)
|
||||
assert.match(view, /\.detail-grid \{[^}]*grid-template-columns: repeat\(4, minmax\(0, 1fr\)\)/)
|
||||
assert.match(view, /\.detail-grid div \{[^}]*min-height: 34px;[^}]*grid-template-columns: 76px minmax\(0, 1fr\)/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user