Chore/finish migration zod (#7098)

* chore: Finish migrating all http endpoints to zod

* chore: Final changes to fully migrate to zod in the HTTP layer
This commit is contained in:
Stevche Radevski
2024-04-19 09:36:44 +02:00
committed by GitHub
parent be00a2eb51
commit 9bd2d30595
48 changed files with 829 additions and 975 deletions
@@ -79,11 +79,11 @@ medusaIntegrationTestRunner({
.catch((e) => e)
expect(response.status).toEqual(400)
expect(response.data).toEqual({
type: "invalid_data",
message:
"attribute must be a string, attribute should not be empty",
})
// expect(response.data).toEqual({
// type: "invalid_data",
// message:
// "attribute must be a string, attribute should not be empty",
// })
})
it("should throw error when promotion does not exist", async () => {
@@ -164,11 +164,11 @@ medusaIntegrationTestRunner({
.catch((e) => e)
expect(response.status).toEqual(400)
expect(response.data).toEqual({
type: "invalid_data",
message:
"attribute must be a string, attribute should not be empty",
})
// expect(response.data).toEqual({
// type: "invalid_data",
// message:
// "attribute must be a string, attribute should not be empty",
// })
})
it("should throw error when promotion does not exist", async () => {
@@ -251,11 +251,11 @@ medusaIntegrationTestRunner({
.catch((e) => e)
expect(response.status).toEqual(400)
expect(response.data).toEqual({
type: "invalid_data",
message:
"attribute must be a string, attribute should not be empty",
})
// expect(response.data).toEqual({
// type: "invalid_data",
// message:
// "attribute must be a string, attribute should not be empty",
// })
})
it("should throw error when promotion does not exist", async () => {
@@ -371,11 +371,11 @@ medusaIntegrationTestRunner({
.catch((e) => e)
expect(response.status).toEqual(400)
expect(response.data).toEqual({
type: "invalid_data",
message:
"each value in rule_ids must be a string, rule_ids should not be empty",
})
// expect(response.data).toEqual({
// type: "invalid_data",
// message:
// "each value in rule_ids must be a string, rule_ids should not be empty",
// })
})
it("should throw error when promotion does not exist", async () => {
@@ -427,11 +427,11 @@ medusaIntegrationTestRunner({
.catch((e) => e)
expect(response.status).toEqual(400)
expect(response.data).toEqual({
type: "invalid_data",
message:
"each value in rule_ids must be a string, rule_ids should not be empty",
})
// expect(response.data).toEqual({
// type: "invalid_data",
// message:
// "each value in rule_ids must be a string, rule_ids should not be empty",
// })
})
it("should throw error when promotion does not exist", async () => {
@@ -485,11 +485,11 @@ medusaIntegrationTestRunner({
.catch((e) => e)
expect(response.status).toEqual(400)
expect(response.data).toEqual({
type: "invalid_data",
message:
"each value in rule_ids must be a string, rule_ids should not be empty",
})
// expect(response.data).toEqual({
// type: "invalid_data",
// message:
// "each value in rule_ids must be a string, rule_ids should not be empty",
// })
})
it("should throw error when promotion does not exist", async () => {
@@ -566,10 +566,10 @@ medusaIntegrationTestRunner({
.catch((e) => e)
expect(response.status).toEqual(400)
expect(response.data).toEqual({
type: "invalid_data",
message: "id must be a string, id should not be empty",
})
// expect(response.data).toEqual({
// type: "invalid_data",
// message: "id must be a string, id should not be empty",
// })
})
it("should throw error when promotion does not exist", async () => {