Skip to content

Commit 87bc975

Browse files
authored
Merge branch 'develop' into fix/admin-allocate-improvement
2 parents a0bf7fa + 839efaf commit 87bc975

171 files changed

Lines changed: 1444 additions & 827 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/fast-ears-own.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/few-owls-push.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/odd-apricots-marry.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@medusajs/link-modules": patch
3+
"@medusajs/core-flows": patch
4+
---
5+
6+
fix(link-modules,core-flows): Carry over cart promotions to order promotions

.changeset/smart-singers-dress.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/sour-ladybugs-check.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

.changeset/tough-horses-return.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

integration-tests/http/CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# integration-tests-http
22

3+
## 1.0.19
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`e9a33d0700c47c3d2357bb325791bc272a4d4569`](https://github.com/medusajs/medusa/commit/e9a33d0700c47c3d2357bb325791bc272a4d4569), [`46bf7ae7aead3f33485ce8adebb602eda305088c`](https://github.com/medusajs/medusa/commit/46bf7ae7aead3f33485ce8adebb602eda305088c), [`2f70f133511857b499a992b65a0a4d6170e03ab9`](https://github.com/medusajs/medusa/commit/2f70f133511857b499a992b65a0a4d6170e03ab9), [`fa76f85bba253528964bacf86c061fef6d3d0742`](https://github.com/medusajs/medusa/commit/fa76f85bba253528964bacf86c061fef6d3d0742), [`42be9a88d61a11db7aebde2d6f4d96d43f54ea79`](https://github.com/medusajs/medusa/commit/42be9a88d61a11db7aebde2d6f4d96d43f54ea79)]:
8+
- @medusajs/test-utils@2.8.7
9+
- @medusajs/core-flows@2.8.7
10+
- @medusajs/api-key@2.8.7
11+
- @medusajs/auth@2.8.7
12+
- @medusajs/fulfillment@2.8.7
13+
- @medusajs/inventory@2.8.7
14+
- @medusajs/pricing@2.8.7
15+
- @medusajs/product@2.8.7
16+
- @medusajs/promotion@2.8.7
17+
- @medusajs/region@2.8.7
18+
- @medusajs/stock-location@2.8.7
19+
- @medusajs/store@2.8.7
20+
- @medusajs/medusa@2.8.7
21+
- @medusajs/customer@2.8.7
22+
- @medusajs/tax@2.8.7
23+
- @medusajs/user@2.8.7
24+
- @medusajs/workflow-engine-inmemory@2.8.7
25+
- @medusajs/modules-sdk@2.8.7
26+
- @medusajs/utils@2.8.7
27+
- @medusajs/cache-inmemory@2.8.7
28+
- @medusajs/event-bus-local@2.8.7
29+
- @medusajs/fulfillment-manual@2.8.7
30+
331
## 1.0.18
432

533
### Patch Changes

integration-tests/http/__tests__/cart/store/cart.spec.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,60 @@ medusaIntegrationTestRunner({
12521252
)
12531253
})
12541254

1255+
it("should successfully complete cart with promotions", async () => {
1256+
const oldCart = (
1257+
await api.get(`/store/carts/${cart.id}`, storeHeaders)
1258+
).data.cart
1259+
1260+
createCartCreditLinesWorkflow.run({
1261+
input: [
1262+
{
1263+
cart_id: oldCart.id,
1264+
amount: oldCart.total,
1265+
currency_code: "usd",
1266+
reference: "test",
1267+
reference_id: "test",
1268+
},
1269+
],
1270+
container: appContainer,
1271+
})
1272+
1273+
const cartResponse = await api.post(
1274+
`/store/carts/${cart.id}/complete`,
1275+
{},
1276+
storeHeaders
1277+
)
1278+
1279+
const orderResponse = await api.get(
1280+
`/store/orders/${cartResponse.data.order.id}?fields=+promotions.*`,
1281+
storeHeaders
1282+
)
1283+
1284+
expect(cartResponse.status).toEqual(200)
1285+
expect(orderResponse.data.order).toEqual(
1286+
expect.objectContaining({
1287+
promotions: [
1288+
expect.objectContaining({
1289+
code: promotion.code,
1290+
}),
1291+
],
1292+
items: expect.arrayContaining([
1293+
expect.objectContaining({
1294+
unit_price: 1500,
1295+
compare_at_unit_price: null,
1296+
quantity: 1,
1297+
adjustments: expect.arrayContaining([
1298+
expect.objectContaining({
1299+
amount: 100,
1300+
code: promotion.code,
1301+
}),
1302+
]),
1303+
}),
1304+
]),
1305+
})
1306+
)
1307+
})
1308+
12551309
it("should successfully complete cart without shipping for digital products", async () => {
12561310
/**
12571311
* Product has a shipping profile so cart item should not require shipping

integration-tests/http/__tests__/promotions/admin/promotions.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,6 +1731,7 @@ medusaIntegrationTestRunner({
17311731
{
17321732
code: "TEST_TWO",
17331733
application_method: { value: 200 },
1734+
is_tax_inclusive: true,
17341735
},
17351736
adminHeaders
17361737
)
@@ -1743,6 +1744,7 @@ medusaIntegrationTestRunner({
17431744
application_method: expect.objectContaining({
17441745
value: 200,
17451746
}),
1747+
is_tax_inclusive: true,
17461748
})
17471749
)
17481750
})

integration-tests/http/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "integration-tests-http",
3-
"version": "1.0.18",
3+
"version": "1.0.19",
44
"main": "index.js",
55
"license": "MIT",
66
"private": true,

0 commit comments

Comments
 (0)