feat(medusa): Continue create product workflow changes (#4473)
This commit is contained in:
committed by
GitHub
parent
edf93d972d
commit
d2a8cf0378
@@ -43,7 +43,9 @@ Object {
|
||||
"metadata": null,
|
||||
"mid_code": null,
|
||||
"origin_country": null,
|
||||
"profile": Any<Object>,
|
||||
"profile_id": Any<String>,
|
||||
"profiles": Any<Array>,
|
||||
"status": "draft",
|
||||
"subtitle": null,
|
||||
"thumbnail": null,
|
||||
@@ -157,7 +159,9 @@ Object {
|
||||
"metadata": null,
|
||||
"mid_code": null,
|
||||
"origin_country": null,
|
||||
"profile": Any<Object>,
|
||||
"profile_id": Any<String>,
|
||||
"profiles": Any<Array>,
|
||||
"status": "draft",
|
||||
"subtitle": null,
|
||||
"thumbnail": null,
|
||||
|
||||
@@ -12,10 +12,7 @@ const {
|
||||
DiscountConditionOperator,
|
||||
} = require("@medusajs/medusa")
|
||||
const { IdMap } = require("medusa-test-utils")
|
||||
const {
|
||||
simpleDiscountFactory,
|
||||
simpleSalesChannelFactory,
|
||||
} = require("../../../factories")
|
||||
const { simpleDiscountFactory } = require("../../../factories")
|
||||
|
||||
jest.setTimeout(30000)
|
||||
|
||||
|
||||
@@ -1879,7 +1879,7 @@ describe("/admin/discounts", () => {
|
||||
const cond = discount.data.discount.rule.conditions[0]
|
||||
|
||||
const response = await api.post(
|
||||
`/admin/discounts/test-discount/conditions/${cond.id}?expand=rule,rule.conditions,rule.conditions.products`,
|
||||
`/admin/discounts/test-discount/conditions/${cond.id}?expand=rule.conditions.products.profiles`,
|
||||
{
|
||||
products: [prod2.id],
|
||||
},
|
||||
@@ -1911,6 +1911,8 @@ describe("/admin/discounts", () => {
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
profile_id: expect.any(String),
|
||||
profiles: expect.any(Array),
|
||||
profile: expect.any(Object),
|
||||
type_id: expect.any(String),
|
||||
id: "test-product",
|
||||
},
|
||||
@@ -2047,7 +2049,7 @@ describe("/admin/discounts", () => {
|
||||
const api = useApi()
|
||||
|
||||
const discountCondition = await api.get(
|
||||
"/admin/discounts/test-discount/conditions/test-condition?expand=products&fields=id,type",
|
||||
"/admin/discounts/test-discount/conditions/test-condition?expand=products.profiles&fields=id,type",
|
||||
adminReqConfig
|
||||
)
|
||||
|
||||
@@ -2061,6 +2063,8 @@ describe("/admin/discounts", () => {
|
||||
{
|
||||
id: "test-product",
|
||||
profile_id: expect.any(String),
|
||||
profiles: expect.any(Array),
|
||||
profile: expect.any(Object),
|
||||
type_id: expect.any(String),
|
||||
created_at: expect.any(String),
|
||||
updated_at: expect.any(String),
|
||||
@@ -2353,7 +2357,7 @@ describe("/admin/discounts", () => {
|
||||
const cond = discount.data.discount.rule.conditions[0]
|
||||
|
||||
const response = await api.post(
|
||||
`/admin/discounts/test-discount/conditions/${cond.id}/batch?expand=rule,rule.conditions,rule.conditions.products`,
|
||||
`/admin/discounts/test-discount/conditions/${cond.id}/batch?expand=rule.conditions.products.profiles`,
|
||||
{
|
||||
resources: [{ id: prod2.id }, { id: prod3.id }],
|
||||
},
|
||||
@@ -2490,7 +2494,7 @@ describe("/admin/discounts", () => {
|
||||
const cond = discount.data.discount.rule.conditions[0]
|
||||
|
||||
const response = await api.delete(
|
||||
`/admin/discounts/test-discount/conditions/${cond.id}/batch?expand=rule,rule.conditions,rule.conditions.products`,
|
||||
`/admin/discounts/test-discount/conditions/${cond.id}/batch?expand=rule.conditions.products.profiles`,
|
||||
{
|
||||
...adminReqConfig,
|
||||
data: {
|
||||
|
||||
@@ -26,9 +26,6 @@ const { IdMap } = require("medusa-test-utils")
|
||||
|
||||
jest.setTimeout(50000)
|
||||
|
||||
const testProductId = "test-product"
|
||||
const testProduct1Id = "test-product1"
|
||||
const testProductFilteringId1 = "test-product_filtering_1"
|
||||
const adminHeaders = {
|
||||
headers: {
|
||||
Authorization: "Bearer test_token",
|
||||
|
||||
@@ -28,7 +28,7 @@ describe("/admin/shipping-options", () => {
|
||||
beforeAll(async () => {
|
||||
const cwd = path.resolve(path.join(__dirname, "..", ".."))
|
||||
dbConnection = await initDb({ cwd })
|
||||
medusaProcess = await setupServer({ cwd, verbose: false })
|
||||
medusaProcess = await setupServer({ cwd })
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
@@ -25,7 +25,7 @@ describe("/admin/shipping-profiles", () => {
|
||||
beforeAll(async () => {
|
||||
const cwd = path.resolve(path.join(__dirname, "..", ".."))
|
||||
dbConnection = await initDb({ cwd })
|
||||
medusaProcess = await setupServer({ cwd, verbose: false })
|
||||
medusaProcess = await setupServer({ cwd })
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
Reference in New Issue
Block a user