All tests passes

This commit is contained in:
olivermrbl
2020-08-20 09:19:54 +02:00
parent 9028a5afab
commit fa6b131111
6 changed files with 31 additions and 0 deletions
@@ -34,6 +34,7 @@ export default async (req, res) => {
)
res.json({ products })
} catch (error) {
console.log(error)
throw error
}
}
@@ -88,6 +88,7 @@ export const orders = {
title: "merge line",
description: "This is a new line",
thumbnail: "test-img-yeah.com/thumb",
returned_quantity: 0,
content: {
unit_price: 123,
variant: {
@@ -166,6 +167,7 @@ export const orders = {
quantity: 1,
},
quantity: 10,
returned_quantity: 0,
},
{
_id: IdMap.getId("existingLine2"),
@@ -0,0 +1,11 @@
export const CounterServiceMock = {
getNext: jest.fn().mockImplementation(data => {
return Promise.resolve()
}),
}
const mock = jest.fn().mockImplementation(() => {
return CounterServiceMock
})
export default mock
@@ -0,0 +1,11 @@
export const QueryBuilderServiceMock = {
buildQuery: jest.fn().mockImplementation(data => {
return Promise.resolve()
}),
}
const mock = jest.fn().mockImplementation(() => {
return QueryBuilderServiceMock
})
export default mock
@@ -22,6 +22,9 @@ export const TotalsServiceMock = {
}
return 0
}),
getRefundedTotal: jest.fn().mockImplementation((order, lineItems) => {
return Promise.resolve()
}),
}
const mock = jest.fn().mockImplementation(() => {
@@ -14,6 +14,7 @@ import {
import { ShippingProfileServiceMock } from "../__mocks__/shipping-profile"
import { TotalsServiceMock } from "../__mocks__/totals"
import { RegionServiceMock } from "../__mocks__/region"
import { CounterServiceMock } from "../__mocks__/counter"
import { EventBusServiceMock } from "../__mocks__/event-bus"
describe("OrderService", () => {
@@ -46,6 +47,7 @@ describe("OrderService", () => {
discountService: DiscountServiceMock,
regionService: RegionServiceMock,
eventBusService: EventBusServiceMock,
counterService: CounterServiceMock
})
beforeEach(async () => {
@@ -468,6 +470,7 @@ describe("OrderService", () => {
quantity: 10,
},
],
metadata: {},
provider_id: "default_provider",
},
],