优化
This commit is contained in:
@@ -100,6 +100,7 @@ function measurement(overrides: Partial<InboundMeasurementDetail> = {}): Inbound
|
||||
async function mountPanel(permissions = [
|
||||
'platform:firstleg:inbound:measure:view',
|
||||
'platform:firstleg:inbound:measure:edit',
|
||||
'platform:firstleg:inbound:measure:manual-entry',
|
||||
'platform:firstleg:inbound:measure:submit',
|
||||
]) {
|
||||
const pinia = createPinia()
|
||||
@@ -170,6 +171,16 @@ describe('InboundMeasurementPanel', () => {
|
||||
expect(document.body.textContent).toContain('保存箱规')
|
||||
})
|
||||
|
||||
it('does not expose manual carton entry without its dedicated permission', async () => {
|
||||
const wrapper = await mountPanel([
|
||||
'platform:firstleg:inbound:measure:view',
|
||||
'platform:firstleg:inbound:measure:edit',
|
||||
'platform:firstleg:inbound:measure:submit',
|
||||
])
|
||||
|
||||
expect(wrapper.text()).not.toContain('手动录入箱规')
|
||||
})
|
||||
|
||||
it('does not expose unknown measurement source codes', async () => {
|
||||
vi.mocked(getInboundMeasurement).mockResolvedValueOnce(measurement({ sourceType: 'LEGACY_DEVICE' }))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user