chore(medusa): Typeorm upgrade to 0.3.11 (#3041)
This commit is contained in:
1 parent
8137061908
commit
121b42acfe
275 files changed
+4493
-4780
No files matched your search
@@ -470,7 +470,7 @@ describe("/admin/order-edits", () => {
|
||||
withDeleted: true,
|
||||
})
|
||||
|
||||
expect(orderEdit).toBeUndefined()
|
||||
expect(orderEdit).toBeNull()
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data).toEqual({
|
||||
id,
|
||||
@@ -534,7 +534,7 @@ describe("/admin/order-edits", () => {
|
||||
withDeleted: true,
|
||||
})
|
||||
|
||||
expect(orderEdit).toBeUndefined()
|
||||
expect(orderEdit).toBeNull()
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data).toEqual({
|
||||
id: orderEditId,
|
||||
|
||||
@@ -2123,7 +2123,9 @@ describe("/admin/orders", () => {
|
||||
|
||||
const manager = dbConnection.manager
|
||||
const customOptions = await manager.find(CustomShippingOption, {
|
||||
shipping_option_id: "test-option",
|
||||
where: {
|
||||
shipping_option_id: "test-option",
|
||||
},
|
||||
})
|
||||
|
||||
expect(response.status).toEqual(200)
|
||||
|
||||
@@ -23,7 +23,7 @@ const adminReqConfig = {
|
||||
},
|
||||
}
|
||||
|
||||
jest.setTimeout(30000)
|
||||
jest.setTimeout(50000)
|
||||
|
||||
describe("/admin/price-lists", () => {
|
||||
let medusaProcess
|
||||
@@ -1108,52 +1108,66 @@ describe("/admin/price-lists", () => {
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data.count).toEqual(2)
|
||||
expect(response.data.products).toHaveLength(2)
|
||||
expect(response.data.products).toEqual([
|
||||
expect.objectContaining({
|
||||
id: "test-prod-2",
|
||||
variants: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-variant-3",
|
||||
prices: expect.arrayContaining([
|
||||
expect.objectContaining({ currency_code: "usd", amount: 100 }),
|
||||
]),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-variant-4",
|
||||
prices: expect.arrayContaining([
|
||||
expect.objectContaining({ currency_code: "usd", amount: 100 }),
|
||||
expect.objectContaining({
|
||||
currency_code: "usd",
|
||||
amount: 150,
|
||||
price_list_id: "test-list",
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-prod-1",
|
||||
variants: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-variant-1",
|
||||
prices: expect.arrayContaining([
|
||||
expect.objectContaining({ currency_code: "usd", amount: 100 }),
|
||||
expect.objectContaining({
|
||||
currency_code: "usd",
|
||||
amount: 150,
|
||||
price_list_id: "test-list",
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-variant-2",
|
||||
prices: expect.arrayContaining([
|
||||
expect.objectContaining({ currency_code: "usd", amount: 100 }),
|
||||
]),
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
])
|
||||
expect(response.data.products).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-prod-1",
|
||||
variants: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-variant-1",
|
||||
prices: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
currency_code: "usd",
|
||||
amount: 100,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
currency_code: "usd",
|
||||
amount: 150,
|
||||
price_list_id: "test-list",
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-variant-2",
|
||||
prices: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
currency_code: "usd",
|
||||
amount: 100,
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-prod-2",
|
||||
variants: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-variant-3",
|
||||
prices: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
currency_code: "usd",
|
||||
amount: 100,
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-variant-4",
|
||||
prices: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
currency_code: "usd",
|
||||
amount: 100,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
currency_code: "usd",
|
||||
amount: 150,
|
||||
price_list_id: "test-list",
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
])
|
||||
)
|
||||
})
|
||||
|
||||
it("lists only product 2", async () => {
|
||||
|
||||
@@ -2142,7 +2142,6 @@ describe("/admin/products", () => {
|
||||
const variant = response.data.product.variants.find(
|
||||
(v) => v.id === variantId
|
||||
)
|
||||
|
||||
expect(variant.prices.length).toEqual(data.prices.length)
|
||||
|
||||
expect(variant.prices).toEqual(
|
||||
@@ -2467,10 +2466,10 @@ describe("/admin/products", () => {
|
||||
const api = useApi()
|
||||
|
||||
const variantPre = await dbConnection.manager.findOne(ProductVariant, {
|
||||
id: "test-variant",
|
||||
where: { id: "test-variant" },
|
||||
})
|
||||
|
||||
expect(variantPre).not.toEqual(undefined)
|
||||
expect(variantPre).toBeTruthy()
|
||||
|
||||
const response = await api
|
||||
.delete("/admin/products/test-product", adminHeaders)
|
||||
@@ -2488,10 +2487,10 @@ describe("/admin/products", () => {
|
||||
)
|
||||
|
||||
const variant = await dbConnection.manager.findOne(ProductVariant, {
|
||||
id: "test-variant",
|
||||
where: { id: "test-variant" },
|
||||
})
|
||||
|
||||
expect(variant).toEqual(undefined)
|
||||
expect(variant).not.toBeTruthy()
|
||||
})
|
||||
|
||||
it("successfully deletes a product variant and its associated option values", async () => {
|
||||
@@ -2499,10 +2498,10 @@ describe("/admin/products", () => {
|
||||
|
||||
// Validate that the option value exists
|
||||
const optValPre = await dbConnection.manager.findOne(ProductOptionValue, {
|
||||
variant_id: "test-variant_2",
|
||||
where: { variant_id: "test-variant_2" },
|
||||
})
|
||||
|
||||
expect(optValPre).not.toEqual(undefined)
|
||||
expect(optValPre).toBeTruthy()
|
||||
|
||||
// Soft delete the variant
|
||||
const response = await api.delete(
|
||||
@@ -2515,20 +2514,18 @@ describe("/admin/products", () => {
|
||||
// Validate that the option value was deleted
|
||||
const optValPost = await dbConnection.manager.findOne(
|
||||
ProductOptionValue,
|
||||
{
|
||||
variant_id: "test-variant_2",
|
||||
}
|
||||
{ where: { variant_id: "test-variant_2" } }
|
||||
)
|
||||
|
||||
expect(optValPost).toEqual(undefined)
|
||||
expect(optValPost).not.toBeTruthy()
|
||||
|
||||
// Validate that the option still exists in the DB with deleted_at
|
||||
const optValDeleted = await dbConnection.manager.findOne(
|
||||
ProductOptionValue,
|
||||
{
|
||||
variant_id: "test-variant_2",
|
||||
},
|
||||
{
|
||||
where: {
|
||||
variant_id: "test-variant_2",
|
||||
},
|
||||
withDeleted: true,
|
||||
}
|
||||
)
|
||||
@@ -2546,10 +2543,10 @@ describe("/admin/products", () => {
|
||||
|
||||
// Validate that the option value exists
|
||||
const optValPre = await dbConnection.manager.findOne(ProductOptionValue, {
|
||||
variant_id: "test-variant_2",
|
||||
where: { variant_id: "test-variant_2" },
|
||||
})
|
||||
|
||||
expect(optValPre).not.toEqual(undefined)
|
||||
expect(optValPre).toBeTruthy()
|
||||
|
||||
// Soft delete the product
|
||||
const response = await api.delete(
|
||||
@@ -2563,19 +2560,19 @@ describe("/admin/products", () => {
|
||||
const optValPost = await dbConnection.manager.findOne(
|
||||
ProductOptionValue,
|
||||
{
|
||||
variant_id: "test-variant_2",
|
||||
where: { variant_id: "test-variant_2" },
|
||||
}
|
||||
)
|
||||
|
||||
expect(optValPost).toEqual(undefined)
|
||||
expect(optValPost).not.toBeTruthy()
|
||||
|
||||
// Validate that the option still exists in the DB with deleted_at
|
||||
const optValDeleted = await dbConnection.manager.findOne(
|
||||
ProductOptionValue,
|
||||
{
|
||||
variant_id: "test-variant_2",
|
||||
},
|
||||
{
|
||||
where: {
|
||||
variant_id: "test-variant_2",
|
||||
},
|
||||
withDeleted: true,
|
||||
}
|
||||
)
|
||||
@@ -2593,10 +2590,10 @@ describe("/admin/products", () => {
|
||||
|
||||
// Validate that the price exists
|
||||
const pricePre = await dbConnection.manager.findOne(MoneyAmount, {
|
||||
id: "test-price",
|
||||
where: { id: "test-price" },
|
||||
})
|
||||
|
||||
expect(pricePre).not.toEqual(undefined)
|
||||
expect(pricePre).toBeTruthy()
|
||||
|
||||
// Soft delete the variant
|
||||
const response = await api.delete(
|
||||
@@ -2608,21 +2605,18 @@ describe("/admin/products", () => {
|
||||
|
||||
// Validate that the price was deleted
|
||||
const pricePost = await dbConnection.manager.findOne(MoneyAmount, {
|
||||
id: "test-price",
|
||||
where: { id: "test-price" },
|
||||
})
|
||||
|
||||
expect(pricePost).toEqual(undefined)
|
||||
expect(pricePost).not.toBeTruthy()
|
||||
|
||||
// Validate that the price still exists in the DB with deleted_at
|
||||
const optValDeleted = await dbConnection.manager.findOne(
|
||||
MoneyAmount,
|
||||
{
|
||||
const optValDeleted = await dbConnection.manager.findOne(MoneyAmount, {
|
||||
where: {
|
||||
id: "test-price",
|
||||
},
|
||||
{
|
||||
withDeleted: true,
|
||||
}
|
||||
)
|
||||
withDeleted: true,
|
||||
})
|
||||
|
||||
expect(optValDeleted).toEqual(
|
||||
expect.objectContaining({
|
||||
@@ -2637,10 +2631,10 @@ describe("/admin/products", () => {
|
||||
|
||||
// Validate that the price exists
|
||||
const pricePre = await dbConnection.manager.findOne(MoneyAmount, {
|
||||
id: "test-price",
|
||||
where: { id: "test-price" },
|
||||
})
|
||||
|
||||
expect(pricePre).not.toEqual(undefined)
|
||||
expect(pricePre).toBeTruthy()
|
||||
|
||||
// Soft delete the product
|
||||
const response = await api.delete(
|
||||
@@ -2652,21 +2646,18 @@ describe("/admin/products", () => {
|
||||
|
||||
// Validate that the price has been deleted
|
||||
const pricePost = await dbConnection.manager.findOne(MoneyAmount, {
|
||||
id: "test-price",
|
||||
where: { id: "test-price" },
|
||||
})
|
||||
|
||||
expect(pricePost).toEqual(undefined)
|
||||
expect(pricePost).not.toBeTruthy()
|
||||
|
||||
// Validate that the price still exists in the DB with deleted_at
|
||||
const optValDeleted = await dbConnection.manager.findOne(
|
||||
MoneyAmount,
|
||||
{
|
||||
const optValDeleted = await dbConnection.manager.findOne(MoneyAmount, {
|
||||
where: {
|
||||
id: "test-price",
|
||||
},
|
||||
{
|
||||
withDeleted: true,
|
||||
}
|
||||
)
|
||||
withDeleted: true,
|
||||
})
|
||||
|
||||
expect(optValDeleted).toEqual(
|
||||
expect.objectContaining({
|
||||
|
||||
@@ -92,7 +92,7 @@ describe("/admin/shipping-options", () => {
|
||||
)
|
||||
})
|
||||
|
||||
it("fails as it is not allowed to set id from client side", async () => {
|
||||
it("fails to add a a requirement with an id if it does not exists", async () => {
|
||||
const api = useApi()
|
||||
|
||||
const payload = {
|
||||
@@ -123,7 +123,9 @@ describe("/admin/shipping-options", () => {
|
||||
})
|
||||
|
||||
expect(res.status).toEqual(400)
|
||||
expect(res.data.message).toEqual("ID does not exist")
|
||||
expect(res.data.message).toEqual(
|
||||
"Shipping option requirement with id not_allowed does not exist"
|
||||
)
|
||||
})
|
||||
|
||||
it("it successfully updates a set of existing requirements", async () => {
|
||||
@@ -274,7 +276,9 @@ describe("/admin/shipping-options", () => {
|
||||
|
||||
const manager = dbConnection.manager
|
||||
const defaultProfile = await manager.findOne(ShippingProfile, {
|
||||
type: "default",
|
||||
where: {
|
||||
type: ShippingProfile.default,
|
||||
},
|
||||
})
|
||||
|
||||
payload = {
|
||||
@@ -521,7 +525,9 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] /admin/shipping-options", () => {
|
||||
const defaultProfile = await dbConnection.manager.findOne(
|
||||
ShippingProfile,
|
||||
{
|
||||
type: "default",
|
||||
where: {
|
||||
type: ShippingProfile.default,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -75,7 +75,9 @@ describe("/admin/store", () => {
|
||||
medusaProcess = await setupServer({ cwd })
|
||||
|
||||
const manager = dbConnection.manager
|
||||
const store = await manager.findOne(Store, { name: "Medusa Store" })
|
||||
const store = await manager.findOne(Store, {
|
||||
where: { name: "Medusa Store" },
|
||||
})
|
||||
await manager.query(
|
||||
`INSERT INTO store_currencies (store_id, currency_code) VALUES ('${store.id}', 'dkk')`
|
||||
)
|
||||
|
||||
@@ -59,6 +59,7 @@ Object {
|
||||
"title": "Test variant",
|
||||
"upc": "test-upc",
|
||||
"updated_at": Any<String>,
|
||||
"variant_rank": 0,
|
||||
"weight": null,
|
||||
"width": null,
|
||||
},
|
||||
@@ -150,6 +151,7 @@ Object {
|
||||
"title": "Test variant",
|
||||
"upc": "test-upc",
|
||||
"updated_at": Any<String>,
|
||||
"variant_rank": 0,
|
||||
"weight": null,
|
||||
"width": null,
|
||||
},
|
||||
@@ -216,6 +218,7 @@ Object {
|
||||
"title": "test2",
|
||||
"upc": null,
|
||||
"updated_at": Any<String>,
|
||||
"variant_rank": 0,
|
||||
"weight": null,
|
||||
"width": null,
|
||||
},
|
||||
@@ -314,6 +317,7 @@ Object {
|
||||
"title": "Test variant",
|
||||
"upc": "test-upc",
|
||||
"updated_at": Any<String>,
|
||||
"variant_rank": 0,
|
||||
"weight": null,
|
||||
"width": null,
|
||||
},
|
||||
@@ -380,6 +384,7 @@ Object {
|
||||
"title": "Test variant",
|
||||
"upc": "test-upc",
|
||||
"updated_at": Any<String>,
|
||||
"variant_rank": 0,
|
||||
"weight": null,
|
||||
"width": null,
|
||||
},
|
||||
|
||||
+47
-31
@@ -52,7 +52,9 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] Gift Card - Tax calculations", () =>
|
||||
includes_tax: true,
|
||||
})
|
||||
|
||||
customer = await simpleCustomerFactory(dbConnection, { password: 'medusatest' })
|
||||
customer = await simpleCustomerFactory(dbConnection, {
|
||||
password: "medusatest",
|
||||
})
|
||||
customerData = {
|
||||
email: customer.email,
|
||||
password: "medusatest",
|
||||
@@ -64,15 +66,19 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] Gift Card - Tax calculations", () =>
|
||||
is_giftcard: true,
|
||||
discountable: false,
|
||||
options: [{ id: "denom", title: "Denomination" }],
|
||||
variants: [{
|
||||
title: "Gift Card",
|
||||
prices: [{
|
||||
amount: 30000,
|
||||
currency: "usd",
|
||||
region_id: region.id,
|
||||
}],
|
||||
options: [{ option_id: "denom", value: "Denomination" }],
|
||||
}]
|
||||
variants: [
|
||||
{
|
||||
title: "Gift Card",
|
||||
prices: [
|
||||
{
|
||||
amount: 30000,
|
||||
currency: "usd",
|
||||
region_id: region.id,
|
||||
},
|
||||
],
|
||||
options: [{ option_id: "denom", value: "Denomination" }],
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
|
||||
@@ -84,10 +90,12 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] Gift Card - Tax calculations", () =>
|
||||
|
||||
const createCartRes = await api.post("/store/carts", {
|
||||
region_id: region.id,
|
||||
items: [{
|
||||
variant_id: product.variants[0].id,
|
||||
quantity: 1,
|
||||
}],
|
||||
items: [
|
||||
{
|
||||
variant_id: product.variants[0].id,
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
expect(createCartRes.status).toEqual(200)
|
||||
@@ -112,8 +120,8 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] Gift Card - Tax calculations", () =>
|
||||
id: product.variants[0].id,
|
||||
product: expect.objectContaining({
|
||||
is_giftcard: true,
|
||||
})
|
||||
})
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
])
|
||||
)
|
||||
@@ -142,10 +150,12 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] Gift Card - Tax calculations", () =>
|
||||
const getCartResponse = await api.get(`/store/carts/${cartFactory.id}`)
|
||||
const cart = getCartResponse.data.cart
|
||||
await api.post(`/store/carts/${cart.id}/payment-sessions`)
|
||||
const createdOrder = await api.post(`/store/carts/${cart.id}/complete-cart`)
|
||||
const createdOrder = await api.post(
|
||||
`/store/carts/${cart.id}/complete-cart`
|
||||
)
|
||||
|
||||
const createdGiftCards = await dbConnection.manager.find(GiftCard, {
|
||||
where: { order_id: createdOrder.data.data.id }
|
||||
where: { order_id: createdOrder.data.data.id },
|
||||
})
|
||||
const createdGiftCard = createdGiftCards[0]
|
||||
|
||||
@@ -166,14 +176,18 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] Gift Card - Tax calculations", () =>
|
||||
tax_rate: region.tax_rate,
|
||||
})
|
||||
const expensiveProduct = await simpleProductFactory(dbConnection, {
|
||||
variants: [{
|
||||
title: "Product cost higher than gift card balance",
|
||||
prices: [{
|
||||
amount: 50000,
|
||||
currency: "usd",
|
||||
region_id: region.id,
|
||||
}],
|
||||
}]
|
||||
variants: [
|
||||
{
|
||||
title: "Product cost higher than gift card balance",
|
||||
prices: [
|
||||
{
|
||||
amount: 50000,
|
||||
currency: "usd",
|
||||
region_id: region.id,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const customerRes = await api.post("/store/customers", customerData, {
|
||||
@@ -203,7 +217,9 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] Gift Card - Tax calculations", () =>
|
||||
const getCartResponse = await api.get(`/store/carts/${cartFactory.id}`)
|
||||
const cart = getCartResponse.data.cart
|
||||
await api.post(`/store/carts/${cart.id}/payment-sessions`)
|
||||
const createdOrder = await api.post(`/store/carts/${cart.id}/complete-cart`)
|
||||
const createdOrder = await api.post(
|
||||
`/store/carts/${cart.id}/complete-cart`
|
||||
)
|
||||
|
||||
expect(createdOrder.data.data).toEqual(
|
||||
expect.objectContaining({
|
||||
@@ -232,12 +248,12 @@ describe("[MEDUSA_FF_TAX_INCLUSIVE_PRICING] Gift Card - Tax calculations", () =>
|
||||
refundable: 50000,
|
||||
tax_lines: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
rate: 19
|
||||
})
|
||||
rate: 19,
|
||||
}),
|
||||
]),
|
||||
})
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -67,7 +67,9 @@ describe("/store/carts", () => {
|
||||
})
|
||||
|
||||
const defaultProfile = await manager.findOne(ShippingProfile, {
|
||||
type: "default",
|
||||
where: {
|
||||
type: ShippingProfile.default,
|
||||
},
|
||||
})
|
||||
await manager.insert(Product, {
|
||||
id: "test-product",
|
||||
@@ -313,7 +315,7 @@ describe("/store/carts", () => {
|
||||
MedusaError.Codes.INSUFFICIENT_INVENTORY
|
||||
)
|
||||
|
||||
let payments = await manager.find(Payment, { cart_id: cartId })
|
||||
let payments = await manager.find(Payment, { where: { cart_id: cartId } })
|
||||
expect(payments).toHaveLength(1)
|
||||
expect(payments).toContainEqual(
|
||||
expect.objectContaining({
|
||||
@@ -338,7 +340,7 @@ describe("/store/carts", () => {
|
||||
expect(responseSuccess.status).toEqual(200)
|
||||
expect(responseSuccess.data.type).toEqual("order")
|
||||
|
||||
payments = await manager.find(Payment, { cart_id: cartId })
|
||||
payments = await manager.find(Payment, { where: { cart_id: cartId } })
|
||||
expect(payments).toHaveLength(2)
|
||||
expect(payments).toEqual(
|
||||
expect.arrayContaining([
|
||||
@@ -391,7 +393,9 @@ describe("/store/carts", () => {
|
||||
expect(responseSuccess.status).toEqual(200)
|
||||
expect(responseSuccess.data.type).toEqual("order")
|
||||
|
||||
const payments = await manager.find(Payment, { cart_id: cartId })
|
||||
const payments = await manager.find(Payment, {
|
||||
where: { cart_id: cartId },
|
||||
})
|
||||
expect(payments).toHaveLength(1)
|
||||
expect(payments).toContainEqual(
|
||||
expect.objectContaining({
|
||||
|
||||
@@ -48,7 +48,9 @@ describe("/store/carts", () => {
|
||||
)
|
||||
|
||||
const defaultProfile = await manager.findOne(ShippingProfile, {
|
||||
type: "default",
|
||||
where: {
|
||||
type: ShippingProfile.default,
|
||||
},
|
||||
})
|
||||
|
||||
await manager.insert(Region, {
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
const path = require("path")
|
||||
const { Region, ShippingProfile, ShippingOption } = require("@medusajs/medusa")
|
||||
const {
|
||||
Region,
|
||||
ShippingProfile,
|
||||
ShippingOption,
|
||||
ShippingProfileType,
|
||||
} = require("@medusajs/medusa")
|
||||
|
||||
const setupServer = require("../../../helpers/setup-server")
|
||||
const { useApi } = require("../../../helpers/use-api")
|
||||
@@ -60,7 +65,9 @@ describe("/store/shipping-options", () => {
|
||||
})
|
||||
|
||||
const defaultProfile = await manager.findOne(ShippingProfile, {
|
||||
type: "default",
|
||||
where: {
|
||||
type: ShippingProfileType.DEFAULT,
|
||||
},
|
||||
})
|
||||
|
||||
await manager.insert(ShippingOption, {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
const path = require("path")
|
||||
const { ShippingProfile, ShippingOption } = require("@medusajs/medusa")
|
||||
const {
|
||||
ShippingProfile,
|
||||
ShippingOption,
|
||||
ShippingProfileType,
|
||||
} = require("@medusajs/medusa")
|
||||
|
||||
const setupServer = require("../../../helpers/setup-server")
|
||||
const { useApi } = require("../../../helpers/use-api")
|
||||
@@ -38,7 +42,9 @@ describe("/store/carts", () => {
|
||||
)
|
||||
|
||||
const defaultProfile = await manager.findOne(ShippingProfile, {
|
||||
type: "default",
|
||||
where: {
|
||||
type: ShippingProfileType.DEFAULT,
|
||||
},
|
||||
})
|
||||
await manager.insert(ShippingOption, {
|
||||
id: "return-option",
|
||||
|
||||
Reference in new issue
Block a user