fix(medusa): Decorate order with totals in store domain (#2747)

This commit is contained in:
Kasper Fabricius Kristensen
2022-12-09 09:42:53 +01:00
committed by GitHub
parent a6243618fe
commit 72f70bc789
4 changed files with 57 additions and 3 deletions
@@ -19,8 +19,8 @@ describe("GET /store/orders", () => {
})
it("calls orderService retrieve", () => {
expect(OrderServiceMock.retrieve).toHaveBeenCalledTimes(1)
expect(OrderServiceMock.retrieve).toHaveBeenCalledWith(
expect(OrderServiceMock.retrieveWithTotals).toHaveBeenCalledTimes(1)
expect(OrderServiceMock.retrieveWithTotals).toHaveBeenCalledWith(
IdMap.getId("test-order"),
{
select: defaultStoreOrdersFields,
@@ -50,7 +50,7 @@ export default async (req, res) => {
const { id } = req.params
const orderService: OrderService = req.scope.resolve("orderService")
const order = await orderService.retrieve(id, {
const order = await orderService.retrieveWithTotals(id, {
select: defaultStoreOrdersFields,
relations: defaultStoreOrdersRelations,
})