feat: GET customer group endpoint

This commit is contained in:
fPolic
2022-02-16 11:55:21 +01:00
parent c2241d1101
commit 21d99a44a9
6 changed files with 121 additions and 0 deletions

View File

@@ -85,4 +85,41 @@ describe("/admin/customer-groups", () => {
})
})
})
describe("GET /admin/customer-groups", () => {
beforeEach(async () => {
try {
await adminSeeder(dbConnection)
await customerSeeder(dbConnection)
} catch (err) {
console.log(err)
throw err
}
})
afterEach(async () => {
const db = useDb()
await db.teardown()
})
it("gets customer group", async () => {
const api = useApi()
const id = "test-group-4"
const response = await api.get(`/admin/customer-groups/${id}`, {
headers: {
Authorization: "Bearer test_token",
},
})
expect(response.status).toEqual(200)
expect(response.data.customerGroup).toEqual(
expect.objectContaining({
id: "test-group-4",
name: "test-group",
})
)
})
})
})