diff --git a/integration-tests/http/__tests__/collection/admin/colllection.spec.ts b/integration-tests/http/__tests__/collection/admin/colllection.spec.ts
index 71d50aa758ab1..b363fb4839bbb 100644
--- a/integration-tests/http/__tests__/collection/admin/colllection.spec.ts
+++ b/integration-tests/http/__tests__/collection/admin/colllection.spec.ts
@@ -77,17 +77,16 @@ medusaIntegrationTestRunner({
)
expect(response.status).toEqual(200)
- expect(response.data).toEqual(
- expect.objectContaining({
- collection: expect.objectContaining({
- id: expect.stringMatching(/^pcol_*/),
- title: "New collection",
- handle: "test-new-collection",
- created_at: expect.any(String),
- updated_at: expect.any(String),
- }),
- })
- )
+ expect(response.data).toEqual({
+ collection: {
+ id: expect.stringMatching(/^pcol_*/),
+ title: "New collection",
+ handle: "test-new-collection",
+ created_at: expect.any(String),
+ updated_at: expect.any(String),
+ metadata: null,
+ },
+ })
})
it("lists collections", async () => {
@@ -96,22 +95,33 @@ medusaIntegrationTestRunner({
expect(response.data).toEqual(
expect.objectContaining({
count: 3,
+ limit: 10,
+ offset: 0,
collections: expect.arrayContaining([
- expect.objectContaining({
- id: baseCollection2.id,
+ {
+ id: baseCollection.id,
created_at: expect.any(String),
updated_at: expect.any(String),
- }),
- expect.objectContaining({
+ handle: "test-collection",
+ metadata: null,
+ title: "test-collection",
+ },
+ {
id: baseCollection1.id,
created_at: expect.any(String),
updated_at: expect.any(String),
- }),
- expect.objectContaining({
- id: baseCollection.id,
+ handle: "test-collection1",
+ metadata: null,
+ title: "test-collection1",
+ },
+ {
+ id: baseCollection2.id,
created_at: expect.any(String),
updated_at: expect.any(String),
- }),
+ handle: "test-collection2",
+ metadata: null,
+ title: "test-collection2",
+ },
]),
})
)
@@ -127,11 +137,14 @@ medusaIntegrationTestRunner({
expect.objectContaining({
count: 1,
collections: expect.arrayContaining([
- expect.objectContaining({
+ {
id: baseCollection.id,
created_at: expect.any(String),
updated_at: expect.any(String),
- }),
+ handle: "test-collection",
+ metadata: null,
+ title: "test-collection",
+ },
]),
})
)
@@ -154,13 +167,14 @@ medusaIntegrationTestRunner({
expect(response.status).toEqual(200)
expect(response.data).toEqual(
expect.objectContaining({
- collection: expect.objectContaining({
+ collection: {
id: expect.stringMatching(/^pcol_*/),
title: "test collection creation",
handle: "test-handle-creation",
created_at: expect.any(String),
updated_at: expect.any(String),
- }),
+ metadata: null,
+ },
})
)
})
diff --git a/integration-tests/http/__tests__/product-type/admin/product-type.spec.ts b/integration-tests/http/__tests__/product-type/admin/product-type.spec.ts
index 654b3d60a3484..21dca450fe0de 100644
--- a/integration-tests/http/__tests__/product-type/admin/product-type.spec.ts
+++ b/integration-tests/http/__tests__/product-type/admin/product-type.spec.ts
@@ -44,12 +44,20 @@ medusaIntegrationTestRunner({
expect(res.status).toEqual(200)
expect(res.data.product_types).toEqual(
expect.arrayContaining([
- expect.objectContaining({
+ {
+ id: expect.stringMatching(/ptyp_.{24}/),
value: "test1",
- }),
- expect.objectContaining({
+ created_at: expect.any(String),
+ updated_at: expect.any(String),
+ metadata: null,
+ },
+ {
+ id: expect.stringMatching(/ptyp_.{24}/),
value: "test2",
- }),
+ created_at: expect.any(String),
+ updated_at: expect.any(String),
+ metadata: null,
+ },
])
)
})
@@ -61,13 +69,35 @@ medusaIntegrationTestRunner({
// The value of the type should match the search param
expect(res.data.product_types).toEqual([
- expect.objectContaining({
+ {
+ id: expect.stringMatching(/ptyp_.{24}/),
value: "test1",
- }),
+ created_at: expect.any(String),
+ updated_at: expect.any(String),
+ metadata: null,
+ },
])
})
// BREAKING: Removed a test around filtering based on discount condition id, which is no longer supported
})
+
+ describe("/admin/product-types/:id", () => {
+ it("returns a product type", async () => {
+ const res = await api.get(
+ `/admin/product-types/${type1.id}`,
+ adminHeaders
+ )
+
+ expect(res.status).toEqual(200)
+ expect(res.data.product_type).toEqual({
+ id: expect.stringMatching(/ptyp_.{24}/),
+ value: "test1",
+ created_at: expect.any(String),
+ updated_at: expect.any(String),
+ metadata: null,
+ })
+ })
+ })
},
})
diff --git a/integration-tests/modules/__tests__/cart/store/cart.workflows.spec.ts b/integration-tests/modules/__tests__/cart/store/cart.workflows.spec.ts
index 23150eb71efb2..9c10a9ac4aaee 100644
--- a/integration-tests/modules/__tests__/cart/store/cart.workflows.spec.ts
+++ b/integration-tests/modules/__tests__/cart/store/cart.workflows.spec.ts
@@ -1170,6 +1170,7 @@ medusaIntegrationTestRunner({
await deleteLineItemsWorkflow(appContainer).run({
input: {
+ cart_id: cart.id,
ids: items.map((i) => i.id),
},
throwOnError: false,
@@ -1211,6 +1212,7 @@ medusaIntegrationTestRunner({
const { errors } = await workflow.run({
input: {
+ cart_id: cart.id,
ids: items.map((i) => i.id),
},
throwOnError: false,
diff --git a/integration-tests/modules/__tests__/cart/store/carts.spec.ts b/integration-tests/modules/__tests__/cart/store/carts.spec.ts
index 34c55da8d0061..a028f5306a565 100644
--- a/integration-tests/modules/__tests__/cart/store/carts.spec.ts
+++ b/integration-tests/modules/__tests__/cart/store/carts.spec.ts
@@ -20,7 +20,7 @@ import {
ProductStatus,
PromotionRuleOperator,
PromotionType,
- RuleOperator
+ RuleOperator,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "medusa-test-utils"
import {
@@ -2131,6 +2131,7 @@ medusaIntegrationTestRunner({
)
expect(response.status).toEqual(200)
+
expect(response.data.cart).toEqual(
expect.objectContaining({
id: cart.id,
diff --git a/integration-tests/modules/__tests__/event-bus/index.spec.ts b/integration-tests/modules/__tests__/event-bus/index.spec.ts
index 61e7b60cdddd2..3f8a8e02fa259 100644
--- a/integration-tests/modules/__tests__/event-bus/index.spec.ts
+++ b/integration-tests/modules/__tests__/event-bus/index.spec.ts
@@ -1,7 +1,7 @@
import { MedusaContainer } from "@medusajs/types"
import { Modules, composeMessage } from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "medusa-test-utils"
-import testEventPayloadHandlerMock from "../../dist/subscribers/test-event-payload"
+import testEventPayloadHandlerMock from "../../src/subscribers/test-event-payload"
jest.setTimeout(30000)
diff --git a/integration-tests/modules/medusa-config.js b/integration-tests/modules/medusa-config.js
index 030678e49a419..08f890690bd25 100644
--- a/integration-tests/modules/medusa-config.js
+++ b/integration-tests/modules/medusa-config.js
@@ -1,5 +1,5 @@
const { Modules } = require("@medusajs/utils")
-const { FulfillmentModuleOptions } = require("@medusajs/fulfillment")
+
const DB_HOST = process.env.DB_HOST
const DB_USERNAME = process.env.DB_USERNAME
const DB_PASSWORD = process.env.DB_PASSWORD
@@ -78,7 +78,6 @@ module.exports = {
[Modules.SALES_CHANNEL]: true,
[Modules.CART]: true,
[Modules.WORKFLOW_ENGINE]: true,
- [Modules.REGION]: true,
[Modules.API_KEY]: true,
[Modules.STORE]: true,
[Modules.TAX]: true,
diff --git a/integration-tests/modules/tsconfig.json b/integration-tests/modules/tsconfig.json
index 4ed062890ede2..55e69b061484d 100644
--- a/integration-tests/modules/tsconfig.json
+++ b/integration-tests/modules/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../_tsconfig.base.json",
"include": ["src", "./medusa/**/*"],
"exclude": [
- "./dist/**/*",
+ "dist",
"__tests__",
"helpers",
"./**/helpers",
@@ -10,4 +10,3 @@
"node_modules"
]
}
-
diff --git a/integration-tests/tsconfig.json b/integration-tests/tsconfig.json
index 4569ac352975f..1f73dce637ac8 100644
--- a/integration-tests/tsconfig.json
+++ b/integration-tests/tsconfig.json
@@ -1,11 +1,5 @@
{
"extends": "../_tsconfig.base.json",
"include": ["**/*"],
- "exclude": [
- "dist",
- "./**/helpers",
- "./**/__snapshots__",
- "node_modules"
- ]
+ "exclude": ["dist", "./**/helpers", "./**/__snapshots__", "node_modules"]
}
-
diff --git a/packages/admin/admin-bundler/src/entry.tsx b/packages/admin/admin-bundler/src/entry.tsx
index 84a8f37b2e2e8..996d8d8030f94 100644
--- a/packages/admin/admin-bundler/src/entry.tsx
+++ b/packages/admin/admin-bundler/src/entry.tsx
@@ -1,9 +1,15 @@
-import App from "@medusajs/dashboard"
-import React from "react"
-import { createRoot } from "react-dom/client"
+import App from "@medusajs/dashboard";
+import React from "react";
+import ReactDOM from "react-dom/client";
+import "./index.css";
-import "./index.css"
+ReactDOM.createRoot(document.getElementById("medusa")!).render(
+