fix: integration test case

This commit is contained in:
fPolic committed 2022-02-21 14:33:20 +01:00
1 parent 963b594a8a
commit 8313680a71
1 file changed
+11 -9
@@ -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,8 +116,8 @@ 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",
})
)
})
@@ -127,19 +127,21 @@ describe("/admin/customer-groups", () => {
const api = useApi()
const id = 'test-group-000'
const id = "test-group-000"
await api.get(`/admin/customer-groups/${id}`, {
await api
.get(`/admin/customer-groups/${id}`, {
headers: {
Authorization: "Bearer test_token",
},
}).catch(err => {
})
.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`)
expect(err.response.data.message).toEqual(
`CustomerGroup with ${id} was not found`
)
})
})
})
})