fix(customers): wait for billing defaults before loading
This commit is contained in:
@@ -93,6 +93,24 @@ describe('CustomerBillingRulesPanel', () => {
|
||||
expect(getCustomerDimensionConfig).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('does not request billing rules before customer defaults are ready', async () => {
|
||||
mount(CustomerBillingRulesPanel, {
|
||||
attachTo: document.body,
|
||||
props: {
|
||||
customerId: '8',
|
||||
customerName: '柏悦物流',
|
||||
dimensionInitializationStatus: 'PENDING',
|
||||
},
|
||||
global: { plugins: [ElementPlus] },
|
||||
})
|
||||
await flushPromises()
|
||||
|
||||
expect(document.body.textContent).toContain('客户计费规则正在初始化')
|
||||
expect(document.body.textContent).not.toContain('箱规尺寸规则加载失败')
|
||||
expect(getCustomerDimensionConfig).not.toHaveBeenCalled()
|
||||
expect(listCustomerChargeRules).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('submits all four rows in one update request', async () => {
|
||||
const wrapper = mount(CustomerBillingRulesPanel, { attachTo: document.body, props: { customerId: '8', customerName: '柏悦物流' }, global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
|
||||
Reference in New Issue
Block a user