chore:ttests
This commit is contained in:
@@ -10,10 +10,10 @@ describe("POST /store/carts/:id/payment-session/update", () => {
|
||||
const cartId = IdMap.getId("cartWithPaySessions")
|
||||
subject = await request(
|
||||
"POST",
|
||||
`/store/carts/${cartId}/payment-session/update`,
|
||||
`/store/carts/${cartId}/payment-sessions/default_provider`,
|
||||
{
|
||||
payload: {
|
||||
session: {
|
||||
data: {
|
||||
data: "Something",
|
||||
},
|
||||
},
|
||||
@@ -26,6 +26,12 @@ describe("POST /store/carts/:id/payment-session/update", () => {
|
||||
})
|
||||
|
||||
it("calls CartService updatePaymentSession", () => {
|
||||
expect(CartServiceMock.setPaymentSession).toHaveBeenCalledTimes(1)
|
||||
expect(CartServiceMock.setPaymentSession).toHaveBeenCalledWith(
|
||||
IdMap.getId("cartWithPaySessions"),
|
||||
"default_provider"
|
||||
)
|
||||
|
||||
expect(CartServiceMock.updatePaymentSession).toHaveBeenCalledTimes(1)
|
||||
expect(CartServiceMock.updatePaymentSession).toHaveBeenCalledWith(
|
||||
IdMap.getId("cartWithPaySessions"),
|
||||
|
||||
@@ -323,6 +323,9 @@ export const CartServiceMock = {
|
||||
applyDiscount: jest.fn().mockImplementation((cartId, code) => {
|
||||
return Promise.resolve()
|
||||
}),
|
||||
setPaymentSession: jest.fn().mockImplementation(cartId => {
|
||||
return Promise.resolve()
|
||||
}),
|
||||
setPaymentSessions: jest.fn().mockImplementation(cartId => {
|
||||
return Promise.resolve()
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user