feat(medusa,stock-location,inventory): Integration tests (#3149)

This commit is contained in:
Carlos R. L. Rodrigues
2023-02-06 09:02:43 -03:00
committed by GitHub
parent 71fdd28198
commit 923ccece24
17 changed files with 2019 additions and 32 deletions
@@ -17,6 +17,8 @@ const {
} = require("@medusajs/medusa")
module.exports = async (connection, data = {}) => {
const salesChannelId = data?.sales_channel_id
const yesterday = ((today) => new Date(today.setDate(today.getDate() - 1)))(
new Date()
)
@@ -240,7 +242,7 @@ module.exports = async (connection, data = {}) => {
is_disabled: false,
starts_at: tenDaysAgo,
ends_at: tenDaysFromToday,
valid_duration: "P1M", //one month
valid_duration: "P1M", // one month
})
DynamicDiscount.regions = [r]
@@ -381,6 +383,7 @@ module.exports = async (connection, data = {}) => {
const cart = manager.create(Cart, {
id: "test-cart",
customer_id: "some-customer",
sales_channel_id: salesChannelId,
email: "some-customer@email.com",
shipping_address: {
id: "test-shipping-address",
@@ -397,6 +400,7 @@ module.exports = async (connection, data = {}) => {
const cart2 = manager.create(Cart, {
id: "test-cart-2",
customer_id: "some-customer",
sales_channel_id: salesChannelId,
email: "some-customer@email.com",
shipping_address: {
id: "test-shipping-address",
@@ -413,6 +417,7 @@ module.exports = async (connection, data = {}) => {
id: "swap-cart",
type: "swap",
customer_id: "some-customer",
sales_channel_id: salesChannelId,
email: "some-customer@email.com",
shipping_address: {
id: "test-shipping-address",