This commit is contained in:
2026-08-12 14:57:02 +08:00
parent 975e0057e3
commit 1ee5a2dec7
10 changed files with 85 additions and 74 deletions
@@ -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' }))