优化
This commit is contained in:
@@ -18,6 +18,23 @@ describe('admin router access metadata', () => {
|
||||
expect(warehouseRoute?.meta.permission).toBe('platform:warehouse:list')
|
||||
})
|
||||
|
||||
it('protects phase-two inbound operations and master data with deployed permissions', () => {
|
||||
const expected = [
|
||||
['inbound-orders', '/inbounds', 'platform:firstleg:inbound:list'],
|
||||
['inbound-order-detail', '/inbounds/:inboundId', 'platform:firstleg:inbound:view'],
|
||||
['fba-customer-rules', '/first-leg-pricing/customer-rules', 'firstleg:fba-pricing:rule:view'],
|
||||
['fba-carrier-rates', '/first-leg-pricing/carrier-rates', 'firstleg:fba-pricing:rate:view'],
|
||||
['locations', '/master-data/locations', 'platform:location:list'],
|
||||
['pallets', '/master-data/pallets', 'platform:pallet:list'],
|
||||
]
|
||||
|
||||
for (const [name, path, permission] of expected) {
|
||||
const route = router.getRoutes().find((item) => item.name === name)
|
||||
expect(route?.path).toBe(path)
|
||||
expect(route?.meta.permission).toBe(permission)
|
||||
}
|
||||
})
|
||||
|
||||
it('protects express company records with a stable master-data permission', () => {
|
||||
const route = router.getRoutes().find((item) => item.name === 'express-companies')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user