chore: update tests
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { IdMap } from "medusa-test-utils"
|
import { IdMap } from "medusa-test-utils"
|
||||||
import { request } from "../../../../../helpers/test-request"
|
import { request } from "../../../../../helpers/test-request"
|
||||||
import { CustomerServiceMock } from "../../../../../services/__mocks__/customer"
|
import { CustomerServiceMock } from "../../../../../services/__mocks__/customer"
|
||||||
|
import { defaultFields, defaultRelations } from "../"
|
||||||
|
|
||||||
describe("POST /store/customers", () => {
|
describe("POST /store/customers", () => {
|
||||||
describe("successfully creates a customer", () => {
|
describe("successfully creates a customer", () => {
|
||||||
@@ -34,7 +35,7 @@ describe("POST /store/customers", () => {
|
|||||||
expect(CustomerServiceMock.retrieve).toHaveBeenCalledTimes(1)
|
expect(CustomerServiceMock.retrieve).toHaveBeenCalledTimes(1)
|
||||||
expect(CustomerServiceMock.retrieve).toHaveBeenCalledWith(
|
expect(CustomerServiceMock.retrieve).toHaveBeenCalledWith(
|
||||||
IdMap.getId("lebron"),
|
IdMap.getId("lebron"),
|
||||||
{ relations: ["shipping_addresses"] }
|
{ relations: defaultRelations, select: defaultFields }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { IdMap } from "medusa-test-utils"
|
import { IdMap } from "medusa-test-utils"
|
||||||
import { request } from "../../../../../helpers/test-request"
|
import { request } from "../../../../../helpers/test-request"
|
||||||
|
import { defaultFields, defaultRelations } from "../"
|
||||||
import { CustomerServiceMock } from "../../../../../services/__mocks__/customer"
|
import { CustomerServiceMock } from "../../../../../services/__mocks__/customer"
|
||||||
|
|
||||||
describe("POST /store/customers/:id", () => {
|
describe("POST /store/customers/:id", () => {
|
||||||
@@ -42,7 +43,7 @@ describe("POST /store/customers/:id", () => {
|
|||||||
expect(CustomerServiceMock.retrieve).toHaveBeenCalledTimes(1)
|
expect(CustomerServiceMock.retrieve).toHaveBeenCalledTimes(1)
|
||||||
expect(CustomerServiceMock.retrieve).toHaveBeenCalledWith(
|
expect(CustomerServiceMock.retrieve).toHaveBeenCalledWith(
|
||||||
IdMap.getId("lebron"),
|
IdMap.getId("lebron"),
|
||||||
{ relations: ["shipping_addresses"] }
|
{ relations: defaultRelations, select: defaultFields }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user