优化
This commit is contained in:
@@ -42,7 +42,7 @@ test('keeps account and notification routes as fixed-header utilities', () => {
|
||||
)
|
||||
})
|
||||
|
||||
test('organises every implemented business page under five task-oriented sidebar entries', () => {
|
||||
test('organises customer-relevant business pages under five task-oriented sidebar entries', () => {
|
||||
assert.deepEqual(
|
||||
clientNavigation.filter((node) => !node.hidden).map((node) => ({
|
||||
title: node.title,
|
||||
@@ -52,11 +52,11 @@ test('organises every implemented business page under five task-oriented sidebar
|
||||
{ title: '首页', children: undefined },
|
||||
{
|
||||
title: '订单中心',
|
||||
children: ['头程订单', '快速建草稿', '海外采购', '美国本土卡', '美本土散板', '入库订单', '派送订单'],
|
||||
children: ['头程订单', '海外采购', '美国本土卡', '美本土散板'],
|
||||
},
|
||||
{
|
||||
title: '海外仓',
|
||||
children: ['贴标申请', '仓储转运', '货物废弃', '退货预报与签收', '退货库存', '退货箱号管理'],
|
||||
children: ['贴标申请', '仓储转运', '货物废弃', '退货预报与签收'],
|
||||
},
|
||||
{
|
||||
title: '费用与账单',
|
||||
@@ -86,18 +86,13 @@ test('flattens visible leaves with unique paths', () => {
|
||||
assert.deepEqual(paths, [
|
||||
'/',
|
||||
'/orders/first-leg',
|
||||
'/first-leg/quick-order',
|
||||
'/cross-border/procurement',
|
||||
'/cross-border/domestic-trucking',
|
||||
'/cross-border/pallet-shipping',
|
||||
'/orders/inbound',
|
||||
'/orders/delivery',
|
||||
'/overseas-warehouse/labeling',
|
||||
'/overseas-warehouse/storage-transfer',
|
||||
'/overseas-warehouse/cargo-disposal',
|
||||
'/overseas-warehouse/return-relabel',
|
||||
'/overseas-warehouse/return-inventory',
|
||||
'/overseas-warehouse/return-cartons',
|
||||
'/finance/account',
|
||||
'/finance/bills',
|
||||
'/company/profile',
|
||||
@@ -340,7 +335,7 @@ test('keeps the dashboard route permission synchronized with navigation', () =>
|
||||
assert.match(dashboardRoute, /permission: 'dashboard:view'/)
|
||||
})
|
||||
|
||||
test('keeps only the unified my-orders placeholder cataloged while activating implemented business pages', () => {
|
||||
test('keeps internal operational pages routable without exposing them in customer navigation', () => {
|
||||
const routerSource = [
|
||||
'first-leg',
|
||||
'cross-border',
|
||||
@@ -357,15 +352,24 @@ test('keeps only the unified my-orders placeholder cataloged while activating im
|
||||
['overseas-warehouse/cargo-disposal', 'WarehouseServiceView.vue'],
|
||||
['overseas-warehouse/return-relabel', 'ReturnOrdersView.vue'],
|
||||
['overseas-warehouse/return-inventory', 'ReturnInventoryView.vue'],
|
||||
['overseas-warehouse/return-cartons', 'ReturnInventoryView.vue'],
|
||||
['orders/my', 'MyOrdersView.vue'],
|
||||
['orders/inbound', 'InboundOrdersView.vue'],
|
||||
['orders/delivery', 'DeliveryOrdersView.vue'],
|
||||
]
|
||||
|
||||
const hiddenActivePaths = new Set([
|
||||
'first-leg/quick-order',
|
||||
'orders/inbound',
|
||||
'orders/delivery',
|
||||
'overseas-warehouse/return-inventory',
|
||||
'overseas-warehouse/return-cartons',
|
||||
])
|
||||
for (const [path, view] of routes) {
|
||||
if (path === 'first-leg/quick-order' || path.startsWith('cross-border/') || path.startsWith('overseas-warehouse/') || path === 'orders/inbound' || path === 'orders/delivery') {
|
||||
if (path !== 'orders/my') {
|
||||
assert.match(routerSource, new RegExp(`path: '${path}'[\\s\\S]*?\\./views/${view.replace('.', '\\.')}[\\s\\S]*?release: 'active'[\\s\\S]*?permission:`))
|
||||
assert.equal(getNavigationLeaves(clientNavigation).some((item) => item.path === `/${path}`), true)
|
||||
const visible = !hiddenActivePaths.has(path)
|
||||
assert.equal(getNavigationLeaves(clientNavigation).some((item) => item.path === `/${path}`), visible)
|
||||
continue
|
||||
}
|
||||
assert.match(routerSource, new RegExp(`path: '${path}'[\\s\\S]*?\\./views/${view.replace('.', '\\.')}[\\s\\S]*?release: 'prototype'[\\s\\S]*?permission:`))
|
||||
|
||||
Reference in New Issue
Block a user