This commit is contained in:
2026-09-04 11:50:34 +08:00
parent e390b88b6c
commit d5662230d5
4 changed files with 84 additions and 44 deletions
@@ -117,6 +117,27 @@ describe('InboundFeePanel', () => {
expect(wrapper.find('.surface-panel').exists()).toBe(false)
})
it('supports a display-only fee snapshot without calculation or transition actions', async () => {
vi.mocked(getLatestInboundFee).mockResolvedValue({ ...snapshot, feeStatus: 'CALCULATED', confirmedAt: null, sentAt: null })
const pinia = setupPermissions([
'firstleg:fba-pricing:view', 'firstleg:fba-pricing:calculate', 'firstleg:fba-pricing:adjust',
'firstleg:fba-pricing:confirm', 'firstleg:inbound:send-fee',
])
const wrapper = mount(InboundFeePanel, {
props: { customerId: '10001', inboundId: '88', displayOnly: true },
global: { plugins: [pinia, ElementPlus] },
})
await flushPromises()
expect(wrapper.find('button[aria-label="刷新费用快照"]').exists()).toBe(true)
expect(wrapper.text()).not.toContain('费用试算')
expect(wrapper.text()).not.toContain('确认费用')
expect(wrapper.text()).not.toContain('确认推送费用')
expect(wrapper.find('[data-testid="adjust-fee-button"]').exists()).toBe(false)
expect(wrapper.find('[data-testid="confirm-fee-button"]').exists()).toBe(false)
expect(wrapper.find('[data-testid="send-fee-button"]').exists()).toBe(false)
})
it('keeps the legacy integration prop compatible while the page layer uses customer context', async () => {
const pinia = setupPermissions(['firstleg:fba-pricing:view'])
mount(InboundFeePanel, {