fix(medusa): cart now returns 404 when not found (#13622)
FIXES #10218 FIXES CORE-739
This commit is contained in:
@@ -9,11 +9,7 @@ import {
|
||||
PromotionStatus,
|
||||
PromotionType,
|
||||
} from "@medusajs/utils"
|
||||
import {
|
||||
createAdminUser,
|
||||
generatePublishableKey,
|
||||
generateStoreHeaders,
|
||||
} from "../../../../helpers/create-admin-user"
|
||||
import { createAdminUser, generatePublishableKey, generateStoreHeaders, } from "../../../../helpers/create-admin-user"
|
||||
import { setupTaxStructure } from "../../../../modules/__tests__/fixtures"
|
||||
import { createAuthenticatedCustomer } from "../../../../modules/helpers/create-authenticated-customer"
|
||||
import { medusaTshirtProduct } from "../../../__fixtures__/product"
|
||||
@@ -152,6 +148,17 @@ medusaIntegrationTestRunner({
|
||||
).data.promotion
|
||||
})
|
||||
|
||||
describe("GET /store/carts/[id]", () => {
|
||||
it("should return 404 when trying to fetch a cart that does not exist", async () => {
|
||||
const response = await api.get(
|
||||
`/store/carts/fake`,
|
||||
storeHeadersWithCustomer
|
||||
).catch((e) => e)
|
||||
|
||||
expect(response.response.status).toEqual(404)
|
||||
})
|
||||
})
|
||||
|
||||
describe("POST /store/carts", () => {
|
||||
it("should successfully create a cart", async () => {
|
||||
const response = await api.post(
|
||||
|
||||
Reference in New Issue
Block a user