完成Salon小程序合规整改
This commit is contained in:
@@ -21,7 +21,7 @@ import adminApi, {
|
||||
adminWorkbenchRegistrationApi
|
||||
} from '../../src/api/admin'
|
||||
import api from '../../src/api'
|
||||
import { afterSaleApi, growthApi, paymentApi } from '../../src/api/order'
|
||||
import { afterSaleApi, growthApi } from '../../src/api/order'
|
||||
|
||||
type CapturedRequest = {
|
||||
method?: string
|
||||
@@ -115,15 +115,11 @@ describe('vNext API contracts', () => {
|
||||
const requests: CapturedRequest[] = []
|
||||
api.defaults.adapter = captureAdapter(requests)
|
||||
|
||||
await paymentApi.prepareOrderPayment(42)
|
||||
await paymentApi.mockSuccess(42)
|
||||
await afterSaleApi.apply({ orderId: 42, type: 'REFUND', reason: 'schedule changed', refundAmount: 88 })
|
||||
await afterSaleApi.listMy({ page: 1, size: 5 })
|
||||
await growthApi.getSummary()
|
||||
|
||||
expect(requests).toEqual([
|
||||
{ method: 'post', url: '/payment/order/42/prepare', params: undefined, data: undefined },
|
||||
{ method: 'post', url: '/payment/order/42/mock-success', params: undefined, data: undefined },
|
||||
{ method: 'post', url: '/after-sale/apply', params: undefined, data: { orderId: 42, type: 'REFUND', reason: 'schedule changed', refundAmount: 88 } },
|
||||
{ method: 'get', url: '/after-sale/my', params: { page: 1, size: 5 }, data: undefined },
|
||||
{ method: 'get', url: '/growth/summary', params: undefined, data: undefined }
|
||||
|
||||
Reference in New Issue
Block a user