diff --git a/src/modules/inbounds/fee/InboundFeePanel.test.ts b/src/modules/inbounds/fee/InboundFeePanel.test.ts index 4a0096b0..3930dfb7 100644 --- a/src/modules/inbounds/fee/InboundFeePanel.test.ts +++ b/src/modules/inbounds/fee/InboundFeePanel.test.ts @@ -121,6 +121,28 @@ describe('InboundFeePanel', () => { expect(wrapper.find('.surface-panel').exists()).toBe(false) }) + it('keeps the compact title and refresh action on one heading row', async () => { + const pinia = setupPermissions(['firstleg:fba-pricing:view']) + const wrapper = mount(InboundFeePanel, { + props: { customerId: '10001', inboundId: '88', compact: true, displayOnly: true }, + global: { plugins: [pinia, ElementPlus] }, + }) + await flushPromises() + + const heading = wrapper.get('.fee-heading--compact') + expect(heading.get('#inbound-fee-title').text()).toBe('头程自动初算') + expect(heading.find('button[aria-label="刷新费用快照"]').exists()).toBe(true) + }) + + it('keeps the refresh icon visible and spinning while the snapshot reloads', () => { + const source = readFileSync(resolve(process.cwd(), 'src/modules/inbounds/fee/InboundFeePanel.vue'), 'utf8') + expect(source).toContain('class="fee-refresh-button"') + expect(source).toContain(':aria-busy="loading"') + expect(source).toContain(``) + expect(source).not.toMatch(/aria-label="刷新费用快照"[^>]*:loading=/) + expect(source).toContain('@keyframes fee-refresh-spin') + }) + 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([ diff --git a/src/modules/inbounds/fee/InboundFeePanel.vue b/src/modules/inbounds/fee/InboundFeePanel.vue index 28f91214..ed9609f0 100644 --- a/src/modules/inbounds/fee/InboundFeePanel.vue +++ b/src/modules/inbounds/fee/InboundFeePanel.vue @@ -364,7 +364,8 @@ defineExpose({ reload: loadFee })