fix(medusa): Normalizes email before saving customer (#1719)

This commit is contained in:
Sebastian Rindom
2022-06-27 10:56:12 +02:00
committed by GitHub
parent 89cb717461
commit 2a32609b74
2 changed files with 17 additions and 1 deletions
@@ -58,6 +58,21 @@ describe("/store/customers", () => {
expect(response.data.customer).not.toHaveProperty("password_hash")
})
it("normalizes email", async () => {
const api = useApi()
const response = await api.post("/store/customers", {
first_name: "James",
last_name: "Bond",
email: "James@Bond.com",
password: "test",
})
expect(response.status).toEqual(200)
expect(response.data.customer).not.toHaveProperty("password_hash")
expect(response.data.customer.email).toEqual("james@bond.com")
})
it("responds 422 on duplicate", async () => {
const api = useApi()