fix: adjustments based on seb's feedback

- remove eager from shipping_option relationship in `models/custom-shipping-options.ts`
- remove custom_shipping_options relation from cart model
This commit is contained in:
zakariaelas
2021-10-13 17:06:35 +01:00
parent 3d088c351b
commit dba1d5bb69
19 changed files with 424 additions and 139 deletions

View File

@@ -30,7 +30,7 @@ describe("/store/carts", () => {
const cwd = path.resolve(path.join(__dirname, "..", ".."))
try {
dbConnection = await initDb({ cwd })
medusaProcess = await setupServer({ cwd })
medusaProcess = await setupServer({ cwd, verbose: true })
} catch (error) {
console.log(error)
}
@@ -467,6 +467,13 @@ describe("/store/carts", () => {
})
cartWithCustomSo = await manager.save(_cart)
await manager.insert(CustomShippingOption, {
id: "another-cso-test",
cart_id: "test-cart-with-cso",
shipping_option_id: "test-option",
price: 5,
})
} catch (err) {
console.log(err)
}
@@ -494,8 +501,7 @@ describe("/store/carts", () => {
})
it("given a cart with custom options and a shipping option already belonging to said cart, then it should add a shipping method based on the given custom shipping option", async () => {
const shippingOptionId =
cartWithCustomSo.custom_shipping_options[0].shipping_option_id
const shippingOptionId = "test-option"
const api = useApi()

View File

@@ -16,7 +16,7 @@ describe("/store/shipping-options", () => {
beforeAll(async () => {
const cwd = path.resolve(path.join(__dirname, "..", ".."))
dbConnection = await initDb({ cwd })
medusaProcess = await setupServer({ cwd })
medusaProcess = await setupServer({ cwd, verbose: true })
})
afterAll(async () => {