chore:ttests
This commit is contained in:
1 parent
91511cbdf8
commit
0f1f51311e
2 files changed
+11
-2
No files matched your search
@@ -10,10 +10,10 @@ describe("POST /store/carts/:id/payment-session/update", () => {
|
|||||||
const cartId = IdMap.getId("cartWithPaySessions")
|
const cartId = IdMap.getId("cartWithPaySessions")
|
||||||
subject = await request(
|
subject = await request(
|
||||||
"POST",
|
"POST",
|
||||||
`/store/carts/${cartId}/payment-session/update`,
|
`/store/carts/${cartId}/payment-sessions/default_provider`,
|
||||||
{
|
{
|
||||||
payload: {
|
payload: {
|
||||||
session: {
|
data: {
|
||||||
data: "Something",
|
data: "Something",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -26,6 +26,12 @@ describe("POST /store/carts/:id/payment-session/update", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("calls CartService updatePaymentSession", () => {
|
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).toHaveBeenCalledTimes(1)
|
||||||
expect(CartServiceMock.updatePaymentSession).toHaveBeenCalledWith(
|
expect(CartServiceMock.updatePaymentSession).toHaveBeenCalledWith(
|
||||||
IdMap.getId("cartWithPaySessions"),
|
IdMap.getId("cartWithPaySessions"),
|
||||||
|
|||||||
@@ -323,6 +323,9 @@ export const CartServiceMock = {
|
|||||||
applyDiscount: jest.fn().mockImplementation((cartId, code) => {
|
applyDiscount: jest.fn().mockImplementation((cartId, code) => {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}),
|
}),
|
||||||
|
setPaymentSession: jest.fn().mockImplementation(cartId => {
|
||||||
|
return Promise.resolve()
|
||||||
|
}),
|
||||||
setPaymentSessions: jest.fn().mockImplementation(cartId => {
|
setPaymentSessions: jest.fn().mockImplementation(cartId => {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in new issue
Block a user