fix: unit test case for CustomerGroupServiceMock.retrieve

This commit is contained in:
fPolic
2022-02-25 18:53:49 +01:00
committed by olivermrbl
parent c75a0cd733
commit aa8bbfdd58
@@ -7,13 +7,17 @@ describe("GET /customer-groups", () => {
const id = "123" const id = "123"
beforeAll(async () => { beforeAll(async () => {
subject = await request("GET", `/admin/customer-groups/${id}`, { subject = await request(
"GET",
`/admin/customer-groups/${id}?expand=customers`,
{
adminSession: { adminSession: {
jwt: { jwt: {
userId: IdMap.getId("admin_user"), userId: IdMap.getId("admin_user"),
}, },
}, },
}) }
)
}) })
it("returns 200", () => { it("returns 200", () => {
@@ -22,6 +26,8 @@ describe("GET /customer-groups", () => {
it("calls CustomerGroupService get", () => { it("calls CustomerGroupService get", () => {
expect(CustomerGroupServiceMock.retrieve).toHaveBeenCalledTimes(1) expect(CustomerGroupServiceMock.retrieve).toHaveBeenCalledTimes(1)
expect(CustomerGroupServiceMock.retrieve).toHaveBeenCalledWith(id) expect(CustomerGroupServiceMock.retrieve).toHaveBeenCalledWith(id, {
relations: ["customers"],
})
}) })
}) })