fix(admin): unify inbound fee refresh controls
This commit is contained in:
@@ -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(`<RefreshCw :size="16" :class="{ 'is-spinning': loading }" />`)
|
||||
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([
|
||||
|
||||
Reference in New Issue
Block a user