From 93d8e8036ed206480083cfa3b67f1b87a271ec22 Mon Sep 17 00:00:00 2001 From: fPolic Date: Mon, 21 Feb 2022 14:33:20 +0100 Subject: [PATCH] fix: integration test case --- .../api/__tests__/admin/customer-groups.js | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/integration-tests/api/__tests__/admin/customer-groups.js b/integration-tests/api/__tests__/admin/customer-groups.js index 9cac01f8ec..768018d29c 100644 --- a/integration-tests/api/__tests__/admin/customer-groups.js +++ b/integration-tests/api/__tests__/admin/customer-groups.js @@ -105,7 +105,7 @@ describe("/admin/customer-groups", () => { it("gets customer group", async () => { const api = useApi() - const id = "test-group-4" + const id = "customer-group-1" const response = await api.get(`/admin/customer-groups/${id}`, { headers: { @@ -116,30 +116,32 @@ describe("/admin/customer-groups", () => { expect(response.status).toEqual(200) expect(response.data.customerGroup).toEqual( expect.objectContaining({ - id: "test-group-4", - name: "test-group", + id: "customer-group-1", + name: "vip-customers", }) ) }) it("throws error when a customer group doesn't exist", async () => { expect.assertions(3) - + const api = useApi() - const id = 'test-group-000' - - await api.get(`/admin/customer-groups/${id}`, { - headers: { - Authorization: "Bearer test_token", - }, - }).catch(err => { - expect(err.response.status).toEqual(404) - expect(err.response.data.type).toEqual("not_found") - expect(err.response.data.message).toEqual(`CustomerGroup with ${id} was not found`) - }) + const id = "test-group-000" + await api + .get(`/admin/customer-groups/${id}`, { + headers: { + Authorization: "Bearer test_token", + }, + }) + .catch((err) => { + expect(err.response.status).toEqual(404) + expect(err.response.data.type).toEqual("not_found") + expect(err.response.data.message).toEqual( + `CustomerGroup with ${id} was not found` + ) + }) }) - }) })