@pradip1995/segment-primitives 0.4.15 → 0.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -8
- package/src/Button.tsx +19 -19
- package/src/Card.tsx +10 -10
- package/src/cart-live.ts +21 -0
- package/src/coupon-apply-result.test.ts +73 -73
- package/src/coupon-apply-result.ts +41 -41
- package/src/coupon-apply.tsx +184 -184
- package/src/format-price.ts +12 -12
- package/src/index.ts +1 -0
- package/src/is-next-redirect.ts +86 -86
- package/src/localized-link.tsx +37 -37
- package/src/notify-wishlist.ts +12 -9
- package/src/order-lines.test.ts +296 -246
- package/src/order-lines.ts +168 -151
- package/src/product-selection-context.tsx +56 -56
- package/src/product-variants.ts +381 -381
- package/src/resolve-media-url.test.ts +96 -0
- package/src/resolve-media-url.ts +202 -146
- package/src/revalidate-wishlist.ts +9 -8
- package/src/section-variants.ts +13 -13
- package/src/use-wishlist-count.ts +32 -32
- package/src/wishlist-count.test.ts +96 -96
- package/src/wishlist-count.ts +26 -26
- package/src/wishlist-ids.ts +83 -0
package/src/notify-wishlist.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { revalidateWishlistCache } from "./revalidate-wishlist"
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { revalidateWishlistCache } from "./revalidate-wishlist"
|
|
4
|
+
import { clearSharedWishlistIdsCache } from "./wishlist-ids"
|
|
5
|
+
import { dispatchWishlistUpdated, type WishlistUpdatedDetail } from "./wishlist-count"
|
|
6
|
+
|
|
7
|
+
export async function notifyWishlistChanged(detail: WishlistUpdatedDetail) {
|
|
8
|
+
// Clear before dispatch so listeners refetch from an empty cache.
|
|
9
|
+
clearSharedWishlistIdsCache()
|
|
10
|
+
dispatchWishlistUpdated(detail)
|
|
11
|
+
await revalidateWishlistCache()
|
|
12
|
+
}
|
package/src/order-lines.test.ts
CHANGED
|
@@ -1,246 +1,296 @@
|
|
|
1
|
-
import assert from "node:assert/strict"
|
|
2
|
-
import { describe, it } from "node:test"
|
|
3
|
-
import {
|
|
4
|
-
outboundExchangeItemIds,
|
|
5
|
-
presentOrderLines,
|
|
6
|
-
type OrderExchangeLike,
|
|
7
|
-
type OrderLineLike,
|
|
8
|
-
} from "./order-lines.ts"
|
|
9
|
-
|
|
10
|
-
const originalRing: OrderLineLike = {
|
|
11
|
-
id: "ordli_ring_8",
|
|
12
|
-
product_id: "prod_ring",
|
|
13
|
-
variant_id: "var_8",
|
|
14
|
-
quantity: 1,
|
|
15
|
-
total: 100,
|
|
16
|
-
created_at: "2026-08-27T12:39:21.453Z",
|
|
17
|
-
detail: {
|
|
18
|
-
fulfilled_quantity: 1,
|
|
19
|
-
delivered_quantity: 1,
|
|
20
|
-
return_requested_quantity: 1,
|
|
21
|
-
returned_quantity: 0,
|
|
22
|
-
},
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const pendant: OrderLineLike = {
|
|
26
|
-
id: "ordli_pendant",
|
|
27
|
-
product_id: "prod_pendant",
|
|
28
|
-
variant_id: "var_default",
|
|
29
|
-
quantity: 1,
|
|
30
|
-
total: 869,
|
|
31
|
-
created_at: "2026-08-27T12:39:21.453Z",
|
|
32
|
-
detail: {
|
|
33
|
-
fulfilled_quantity: 1,
|
|
34
|
-
delivered_quantity: 1,
|
|
35
|
-
return_requested_quantity: 0,
|
|
36
|
-
returned_quantity: 0,
|
|
37
|
-
},
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const replacementRing: OrderLineLike = {
|
|
41
|
-
id: "ordli_ring_7",
|
|
42
|
-
product_id: "prod_ring",
|
|
43
|
-
variant_id: "var_7",
|
|
44
|
-
quantity: 1,
|
|
45
|
-
total: 100,
|
|
46
|
-
created_at: "2026-08-27T12:41:36.022Z",
|
|
47
|
-
detail: {
|
|
48
|
-
fulfilled_quantity: 0,
|
|
49
|
-
delivered_quantity: 0,
|
|
50
|
-
return_requested_quantity: 0,
|
|
51
|
-
returned_quantity: 0,
|
|
52
|
-
},
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const originalSize7: OrderLineLike = {
|
|
56
|
-
...replacementRing,
|
|
57
|
-
id: "ordli_ring_7_original",
|
|
58
|
-
created_at: originalRing.created_at,
|
|
59
|
-
detail: {
|
|
60
|
-
fulfilled_quantity: 1,
|
|
61
|
-
delivered_quantity: 1,
|
|
62
|
-
return_requested_quantity: 0,
|
|
63
|
-
returned_quantity: 0,
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const PRESENT_CASES: {
|
|
68
|
-
name: string
|
|
69
|
-
order: {
|
|
70
|
-
items?: OrderLineLike[] | null
|
|
71
|
-
shipping_total?: number | null
|
|
72
|
-
exchanges?: OrderExchangeLike[] | null
|
|
73
|
-
}
|
|
74
|
-
want: {
|
|
75
|
-
purchasedIds: string[]
|
|
76
|
-
outboundIds: string[]
|
|
77
|
-
inboundIds: string[]
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
],
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
]
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
1
|
+
import assert from "node:assert/strict"
|
|
2
|
+
import { describe, it } from "node:test"
|
|
3
|
+
import {
|
|
4
|
+
outboundExchangeItemIds,
|
|
5
|
+
presentOrderLines,
|
|
6
|
+
type OrderExchangeLike,
|
|
7
|
+
type OrderLineLike,
|
|
8
|
+
} from "./order-lines.ts"
|
|
9
|
+
|
|
10
|
+
const originalRing: OrderLineLike = {
|
|
11
|
+
id: "ordli_ring_8",
|
|
12
|
+
product_id: "prod_ring",
|
|
13
|
+
variant_id: "var_8",
|
|
14
|
+
quantity: 1,
|
|
15
|
+
total: 100,
|
|
16
|
+
created_at: "2026-08-27T12:39:21.453Z",
|
|
17
|
+
detail: {
|
|
18
|
+
fulfilled_quantity: 1,
|
|
19
|
+
delivered_quantity: 1,
|
|
20
|
+
return_requested_quantity: 1,
|
|
21
|
+
returned_quantity: 0,
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const pendant: OrderLineLike = {
|
|
26
|
+
id: "ordli_pendant",
|
|
27
|
+
product_id: "prod_pendant",
|
|
28
|
+
variant_id: "var_default",
|
|
29
|
+
quantity: 1,
|
|
30
|
+
total: 869,
|
|
31
|
+
created_at: "2026-08-27T12:39:21.453Z",
|
|
32
|
+
detail: {
|
|
33
|
+
fulfilled_quantity: 1,
|
|
34
|
+
delivered_quantity: 1,
|
|
35
|
+
return_requested_quantity: 0,
|
|
36
|
+
returned_quantity: 0,
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const replacementRing: OrderLineLike = {
|
|
41
|
+
id: "ordli_ring_7",
|
|
42
|
+
product_id: "prod_ring",
|
|
43
|
+
variant_id: "var_7",
|
|
44
|
+
quantity: 1,
|
|
45
|
+
total: 100,
|
|
46
|
+
created_at: "2026-08-27T12:41:36.022Z",
|
|
47
|
+
detail: {
|
|
48
|
+
fulfilled_quantity: 0,
|
|
49
|
+
delivered_quantity: 0,
|
|
50
|
+
return_requested_quantity: 0,
|
|
51
|
+
returned_quantity: 0,
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const originalSize7: OrderLineLike = {
|
|
56
|
+
...replacementRing,
|
|
57
|
+
id: "ordli_ring_7_original",
|
|
58
|
+
created_at: originalRing.created_at,
|
|
59
|
+
detail: {
|
|
60
|
+
fulfilled_quantity: 1,
|
|
61
|
+
delivered_quantity: 1,
|
|
62
|
+
return_requested_quantity: 0,
|
|
63
|
+
returned_quantity: 0,
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const PRESENT_CASES: {
|
|
68
|
+
name: string
|
|
69
|
+
order: {
|
|
70
|
+
items?: OrderLineLike[] | null
|
|
71
|
+
shipping_total?: number | null
|
|
72
|
+
exchanges?: OrderExchangeLike[] | null
|
|
73
|
+
}
|
|
74
|
+
want: {
|
|
75
|
+
purchasedIds: string[]
|
|
76
|
+
outboundIds: string[]
|
|
77
|
+
inboundIds: string[]
|
|
78
|
+
returnExchangeIds: string[]
|
|
79
|
+
paidSubtotal: number
|
|
80
|
+
paidTotal: number
|
|
81
|
+
hasActiveExchange: boolean
|
|
82
|
+
originalFulfillmentIsComplete: boolean
|
|
83
|
+
reorderIds: string[]
|
|
84
|
+
}
|
|
85
|
+
}[] = [
|
|
86
|
+
{
|
|
87
|
+
name: "hides the exchange replacement from purchased items and paid total",
|
|
88
|
+
order: {
|
|
89
|
+
items: [originalRing, pendant, replacementRing],
|
|
90
|
+
shipping_total: 0,
|
|
91
|
+
},
|
|
92
|
+
want: {
|
|
93
|
+
purchasedIds: ["ordli_ring_8", "ordli_pendant"],
|
|
94
|
+
outboundIds: ["ordli_ring_7"],
|
|
95
|
+
inboundIds: ["ordli_ring_8"],
|
|
96
|
+
// Pending replacement is not yet actionable.
|
|
97
|
+
returnExchangeIds: ["ordli_ring_8", "ordli_pendant"],
|
|
98
|
+
paidSubtotal: 969,
|
|
99
|
+
paidTotal: 969,
|
|
100
|
+
hasActiveExchange: true,
|
|
101
|
+
originalFulfillmentIsComplete: true,
|
|
102
|
+
reorderIds: ["ordli_ring_8", "ordli_pendant"],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "includes a delivered replacement in return/exchange actionable items",
|
|
107
|
+
order: {
|
|
108
|
+
items: [
|
|
109
|
+
{
|
|
110
|
+
...originalRing,
|
|
111
|
+
detail: {
|
|
112
|
+
fulfilled_quantity: 1,
|
|
113
|
+
delivered_quantity: 1,
|
|
114
|
+
return_requested_quantity: 0,
|
|
115
|
+
returned_quantity: 1,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
pendant,
|
|
119
|
+
{
|
|
120
|
+
...replacementRing,
|
|
121
|
+
detail: {
|
|
122
|
+
fulfilled_quantity: 1,
|
|
123
|
+
delivered_quantity: 1,
|
|
124
|
+
return_requested_quantity: 0,
|
|
125
|
+
returned_quantity: 0,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
shipping_total: 0,
|
|
130
|
+
exchanges: [{ additional_items: [{ item_id: "ordli_ring_7" }] }],
|
|
131
|
+
},
|
|
132
|
+
want: {
|
|
133
|
+
purchasedIds: ["ordli_ring_8", "ordli_pendant"],
|
|
134
|
+
outboundIds: ["ordli_ring_7"],
|
|
135
|
+
inboundIds: ["ordli_ring_8"],
|
|
136
|
+
returnExchangeIds: ["ordli_ring_8", "ordli_pendant", "ordli_ring_7"],
|
|
137
|
+
paidSubtotal: 969,
|
|
138
|
+
paidTotal: 969,
|
|
139
|
+
hasActiveExchange: false,
|
|
140
|
+
originalFulfillmentIsComplete: true,
|
|
141
|
+
reorderIds: ["ordli_ring_8", "ordli_pendant"],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "does not treat a second original size of the same product as the replacement",
|
|
146
|
+
order: {
|
|
147
|
+
items: [originalRing, originalSize7],
|
|
148
|
+
shipping_total: 0,
|
|
149
|
+
},
|
|
150
|
+
want: {
|
|
151
|
+
purchasedIds: ["ordli_ring_8", "ordli_ring_7_original"],
|
|
152
|
+
outboundIds: [],
|
|
153
|
+
inboundIds: ["ordli_ring_8"],
|
|
154
|
+
returnExchangeIds: ["ordli_ring_8", "ordli_ring_7_original"],
|
|
155
|
+
paidSubtotal: 200,
|
|
156
|
+
paidTotal: 200,
|
|
157
|
+
hasActiveExchange: true,
|
|
158
|
+
originalFulfillmentIsComplete: true,
|
|
159
|
+
reorderIds: ["ordli_ring_8", "ordli_ring_7_original"],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "empty order has zero totals and no lines",
|
|
164
|
+
order: { items: [], shipping_total: 40 },
|
|
165
|
+
want: {
|
|
166
|
+
purchasedIds: [],
|
|
167
|
+
outboundIds: [],
|
|
168
|
+
inboundIds: [],
|
|
169
|
+
returnExchangeIds: [],
|
|
170
|
+
paidSubtotal: 0,
|
|
171
|
+
paidTotal: 40,
|
|
172
|
+
hasActiveExchange: false,
|
|
173
|
+
originalFulfillmentIsComplete: false,
|
|
174
|
+
reorderIds: [],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "adds shipping to paid total",
|
|
179
|
+
order: {
|
|
180
|
+
items: [pendant],
|
|
181
|
+
shipping_total: 49,
|
|
182
|
+
},
|
|
183
|
+
want: {
|
|
184
|
+
purchasedIds: ["ordli_pendant"],
|
|
185
|
+
outboundIds: [],
|
|
186
|
+
inboundIds: [],
|
|
187
|
+
returnExchangeIds: ["ordli_pendant"],
|
|
188
|
+
paidSubtotal: 869,
|
|
189
|
+
paidTotal: 918,
|
|
190
|
+
hasActiveExchange: false,
|
|
191
|
+
originalFulfillmentIsComplete: true,
|
|
192
|
+
reorderIds: ["ordli_pendant"],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "falls back to unit_price times quantity when total is missing",
|
|
197
|
+
order: {
|
|
198
|
+
items: [
|
|
199
|
+
{
|
|
200
|
+
id: "ordli_loose",
|
|
201
|
+
quantity: 2,
|
|
202
|
+
unit_price: 50,
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
shipping_total: 10,
|
|
206
|
+
},
|
|
207
|
+
want: {
|
|
208
|
+
purchasedIds: ["ordli_loose"],
|
|
209
|
+
outboundIds: [],
|
|
210
|
+
inboundIds: [],
|
|
211
|
+
returnExchangeIds: ["ordli_loose"],
|
|
212
|
+
paidSubtotal: 100,
|
|
213
|
+
paidTotal: 110,
|
|
214
|
+
hasActiveExchange: false,
|
|
215
|
+
originalFulfillmentIsComplete: false,
|
|
216
|
+
reorderIds: ["ordli_loose"],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
]
|
|
220
|
+
|
|
221
|
+
const OUTBOUND_CASES: {
|
|
222
|
+
name: string
|
|
223
|
+
items: OrderLineLike[]
|
|
224
|
+
exchanges?: OrderExchangeLike[] | null
|
|
225
|
+
want: string[]
|
|
226
|
+
}[] = [
|
|
227
|
+
{
|
|
228
|
+
name: "uses exchange additional_items when present",
|
|
229
|
+
items: [originalRing, pendant, replacementRing],
|
|
230
|
+
exchanges: [{ additional_items: [{ item_id: "ordli_ring_7" }] }],
|
|
231
|
+
want: ["ordli_ring_7"],
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "ignores canceled exchange additional_items and infers replacement",
|
|
235
|
+
items: [originalRing, pendant, replacementRing],
|
|
236
|
+
exchanges: [
|
|
237
|
+
{
|
|
238
|
+
canceled_at: "2026-08-27T12:50:00.000Z",
|
|
239
|
+
additional_items: [{ item_id: "ordli_ring_7" }],
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
want: ["ordli_ring_7"],
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "returns empty when there is no inbound exchange item",
|
|
246
|
+
items: [pendant],
|
|
247
|
+
exchanges: [],
|
|
248
|
+
want: [],
|
|
249
|
+
},
|
|
250
|
+
]
|
|
251
|
+
|
|
252
|
+
describe("presentOrderLines", () => {
|
|
253
|
+
for (const tc of PRESENT_CASES) {
|
|
254
|
+
it(tc.name, () => {
|
|
255
|
+
const view = presentOrderLines(tc.order)
|
|
256
|
+
assert.deepEqual(
|
|
257
|
+
view.purchasedItems.map((item) => item.id),
|
|
258
|
+
tc.want.purchasedIds
|
|
259
|
+
)
|
|
260
|
+
assert.deepEqual(
|
|
261
|
+
view.outboundItems.map((item) => item.id),
|
|
262
|
+
tc.want.outboundIds
|
|
263
|
+
)
|
|
264
|
+
assert.deepEqual(
|
|
265
|
+
view.inboundItems.map((item) => item.id),
|
|
266
|
+
tc.want.inboundIds
|
|
267
|
+
)
|
|
268
|
+
assert.deepEqual(
|
|
269
|
+
view.reorderItems.map((item) => item.id),
|
|
270
|
+
tc.want.reorderIds
|
|
271
|
+
)
|
|
272
|
+
assert.deepEqual(
|
|
273
|
+
view.returnExchangeItems.map((item) => item.id),
|
|
274
|
+
tc.want.returnExchangeIds
|
|
275
|
+
)
|
|
276
|
+
assert.equal(view.paidSubtotal, tc.want.paidSubtotal)
|
|
277
|
+
assert.equal(view.paidTotal, tc.want.paidTotal)
|
|
278
|
+
assert.equal(view.hasActiveExchange, tc.want.hasActiveExchange)
|
|
279
|
+
assert.equal(
|
|
280
|
+
view.originalFulfillmentIsComplete,
|
|
281
|
+
tc.want.originalFulfillmentIsComplete
|
|
282
|
+
)
|
|
283
|
+
})
|
|
284
|
+
}
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
describe("outboundExchangeItemIds", () => {
|
|
288
|
+
for (const tc of OUTBOUND_CASES) {
|
|
289
|
+
it(tc.name, () => {
|
|
290
|
+
assert.deepEqual(
|
|
291
|
+
[...outboundExchangeItemIds(tc.items, tc.exchanges)],
|
|
292
|
+
tc.want
|
|
293
|
+
)
|
|
294
|
+
})
|
|
295
|
+
}
|
|
296
|
+
})
|