-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse-excel.pack-specifications.test.ts
More file actions
803 lines (734 loc) · 22.8 KB
/
Copy pathparse-excel.pack-specifications.test.ts
File metadata and controls
803 lines (734 loc) · 22.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
import {
makePackRow,
makeVariantRow,
parseWorkbook,
} from "./helpers/parse-excel";
describe("parse-excel pack specifications", () => {
it("throws on invalid postage size", () => {
expect(() =>
parseWorkbook({
packs: [
makePackRow({
id: "pack-bad-size",
name: "Bad Size Pack",
billingId: "billing-pack-bad-size",
"postage.id": "postage-bad",
"postage.size": "C5",
}),
],
variants: [],
}),
).toThrow(/Validation failed.*pack-bad-size/);
});
it("throws on missing required postage fields", () => {
expect(() =>
parseWorkbook({
packs: [
{
id: "pack-missing",
name: "Missing Pack",
status: "PROD",
version: "1",
createdAt: "2024-01-01",
updatedAt: "2024-01-01",
billingId: "billing-pack-missing",
},
],
variants: [],
}),
).toThrow(/Missing required postage fields/);
});
it("parses constraints on PackSpecification", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-constraints",
name: "Pack with Constraints",
billingId: "billing-pack-with-constraints",
"constraints.sheets": "10",
"constraints.deliveryDays": "5",
"constraints.blackCoveragePercentage": "80.5",
"constraints.colourCoveragePercentage": "50.25",
}),
],
variants: [],
});
expect(result.packs["pack-with-constraints"]?.constraints).toEqual({
sheets: { value: 10, operator: "LESS_THAN_OR_EQUAL" },
deliveryDays: { value: 5, operator: "LESS_THAN_OR_EQUAL" },
blackCoveragePercentage: { value: 80.5, operator: "LESS_THAN_OR_EQUAL" },
colourCoveragePercentage: {
value: 50.25,
operator: "LESS_THAN_OR_EQUAL",
},
});
});
it("parses PackSpecification with optional description", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-description",
name: "Pack with Description",
description: "A standard economy-class letter for bulk mailings",
billingId: "billing-pack-with-description",
}),
],
variants: [],
});
expect(result.packs["pack-with-description"]?.description).toBe(
"A standard economy-class letter for bulk mailings",
);
});
it("parses PackSpecification without description", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-without-description",
name: "Pack without Description",
billingId: "billing-pack-without-description",
}),
],
variants: [],
});
expect(
result.packs["pack-without-description"]?.description,
).toBeUndefined();
});
it("parses assembly with paper, insertIds, and features", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-assembly",
name: "Pack with Assembly",
billingId: "billing-pack-with-assembly",
"assembly.envelopeId": "envelope-1",
"assembly.printColour": "COLOUR",
"assembly.paper.id": "paper-1",
"assembly.paper.name": "Standard White",
"assembly.paper.weightGSM": "90",
"assembly.paper.size": "A4",
"assembly.paper.colour": "WHITE",
"assembly.paper.recycled": "true",
"assembly.insertIds": "insert-1,insert-2",
"assembly.features": "BRAILLE,AUDIO",
}),
],
variants: [],
});
const pack = result.packs["pack-with-assembly"];
expect(pack.assembly?.envelopeId).toBe("envelope-1");
expect(pack.assembly?.printColour).toBe("COLOUR");
expect(pack.assembly?.paper?.id).toBe("paper-1");
expect(pack.assembly?.paper?.name).toBe("Standard White");
expect(pack.assembly?.paper?.weightGSM).toBe(90);
expect(pack.assembly?.paper?.size).toBe("A4");
expect(pack.assembly?.paper?.colour).toBe("WHITE");
expect(pack.assembly?.paper?.recycled).toBe(true);
expect(pack.assembly?.insertIds).toEqual(["insert-1", "insert-2"]);
expect(pack.assembly?.features).toEqual(["BRAILLE", "AUDIO"]);
});
it("parses assembly with duplex set to true", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-duplex-true",
name: "Pack with Duplex True",
billingId: "billing-pack-with-duplex-true",
"assembly.envelopeId": "envelope-1",
"assembly.duplex": "true",
}),
],
variants: [],
});
expect(result.packs["pack-with-duplex-true"]?.assembly?.duplex).toBe(true);
});
it("parses assembly with duplex set to false", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-duplex-false",
name: "Pack with Duplex False",
billingId: "billing-pack-with-duplex-false",
"assembly.envelopeId": "envelope-1",
"assembly.duplex": "false",
}),
],
variants: [],
});
expect(result.packs["pack-with-duplex-false"]?.assembly?.duplex).toBe(
false,
);
});
it("parses assembly without duplex field", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-without-duplex",
name: "Pack without Duplex",
billingId: "billing-pack-without-duplex",
"assembly.envelopeId": "envelope-1",
}),
],
variants: [],
});
expect(
result.packs["pack-without-duplex"]?.assembly?.duplex,
).toBeUndefined();
});
it("parses required billingId field", () => {
const result = parseWorkbook({
packs: [
makePackRow({ id: "pack-with-billing", billingId: "billing-123" }),
],
variants: [],
});
expect(result.packs["pack-with-billing"]?.billingId).toBe("billing-123");
});
it("throws when billingId is missing", () => {
expect(() =>
parseWorkbook({
packs: [
makePackRow({
id: "pack-missing-billing",
name: "Pack Missing Billing",
billingId: undefined,
}),
],
variants: [],
}),
).toThrow(/Missing required billingId.*pack-missing-billing/);
});
it("parses optional postage fields", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-full-postage",
name: "Pack with Full Postage",
billingId: "billing-pack-full-postage",
"postage.size": "LARGE",
"postage.deliveryDays": "2",
"postage.maxWeightGrams": "100.5",
"postage.maxThicknessMm": "5.2",
}),
],
variants: [],
});
const { postage } = result.packs["pack-full-postage"];
expect(postage.deliveryDays).toBe(2);
expect(postage.maxWeightGrams).toBe(100.5);
expect(postage.maxThicknessMm).toBe(5.2);
});
it("handles missing createdAt and updatedAt with default dates", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-no-dates",
name: "Pack No Dates",
createdAt: undefined,
updatedAt: undefined,
billingId: "billing-pack-no-dates",
}),
],
variants: [],
});
expect(result.packs["pack-no-dates"]?.createdAt).toBe(
"2023-01-01T00:00:00Z",
);
expect(result.packs["pack-no-dates"]?.updatedAt).toBe(
"2023-01-01T00:00:00Z",
);
});
it("handles invalid date strings with default date", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-invalid-dates",
name: "Pack Invalid Dates",
createdAt: "not-a-date",
updatedAt: "also-not-a-date",
billingId: "billing-pack-invalid-dates",
}),
],
variants: [],
});
expect(result.packs["pack-invalid-dates"]?.createdAt).toBe(
"2023-01-01T00:00:00Z",
);
expect(result.packs["pack-invalid-dates"]?.updatedAt).toBe(
"2023-01-01T00:00:00Z",
);
});
it("handles empty string arrays as undefined", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-empty-arrays",
name: "Pack Empty Arrays",
billingId: "billing-pack-empty-arrays",
"assembly.insertIds": "",
"assembly.features": " ",
}),
],
variants: [],
});
expect(
result.packs["pack-empty-arrays"]?.assembly?.insertIds,
).toBeUndefined();
expect(
result.packs["pack-empty-arrays"]?.assembly?.features,
).toBeUndefined();
});
it("parses assembly.additional as JSON", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-additional",
name: "Pack with Additional",
billingId: "billing-pack-with-additional",
"assembly.additional": '{"key1":"value1","key2":"value2"}',
}),
],
variants: [],
});
expect(result.packs["pack-with-additional"]?.assembly?.additional).toEqual({
key1: "value1",
key2: "value2",
});
});
it("ignores invalid JSON in assembly.additional", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-bad-json",
name: "Pack Bad JSON",
billingId: "billing-pack-bad-json",
"assembly.additional": "not-valid-json{",
}),
],
variants: [],
});
expect(result.packs["pack-bad-json"]?.assembly?.additional).toBeUndefined();
});
it("parses paper.recycled as boolean", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-recycled-true",
name: "Pack Recycled True",
billingId: "billing-pack-recycled-true",
"assembly.paper.id": "paper-1",
"assembly.paper.name": "Recycled Paper",
"assembly.paper.size": "A4",
"assembly.paper.colour": "WHITE",
"assembly.paper.recycled": "TRUE",
}),
makePackRow({
id: "pack-recycled-false",
name: "Pack Recycled False",
billingId: "billing-pack-recycled-false",
"postage.id": "postage-2",
"postage.size": "LARGE",
"assembly.paper.id": "paper-2",
"assembly.paper.name": "Non-Recycled Paper",
"assembly.paper.size": "A3",
"assembly.paper.colour": "WHITE",
"assembly.paper.recycled": "false",
}),
],
variants: [],
});
expect(result.packs["pack-recycled-true"]?.assembly?.paper?.recycled).toBe(
true,
);
expect(result.packs["pack-recycled-false"]?.assembly?.paper?.recycled).toBe(
false,
);
});
it("uses default weightGSM when not provided", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-default-gsm",
name: "Pack Default GSM",
billingId: "billing-pack-default-gsm",
"assembly.paper.id": "paper-1",
"assembly.paper.size": "A4",
"assembly.paper.colour": "WHITE",
"assembly.paper.recycled": "false",
}),
],
variants: [],
});
expect(result.packs["pack-default-gsm"]?.assembly?.paper?.weightGSM).toBe(
80,
);
});
it("preserves raw ids as parse result keys", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-dashes-123",
name: "Pack with Dashes",
billingId: "billing-pack-with-dashes-123",
}),
],
variants: [
makeVariantRow({
id: "variant_with_underscores_456",
name: "Variant with Underscores",
packSpecificationIds: "pack-with-dashes-123",
}),
],
});
expect(result.packs["pack-with-dashes-123"]).toBeDefined();
expect(result.variants.variant_with_underscores_456).toBeDefined();
});
it("handles partial constraints using only sheets", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-partial-1",
name: "Pack Partial 1",
billingId: "billing-pack-partial-1",
"constraints.sheets": "15",
}),
],
variants: [],
});
expect(result.packs["pack-partial-1"]?.constraints).toEqual({
sheets: { value: 15, operator: "LESS_THAN_OR_EQUAL" },
});
});
it("handles partial constraints using only deliveryDays", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-partial-2",
name: "Pack Partial 2",
billingId: "billing-pack-partial-2",
"constraints.deliveryDays": "7",
}),
],
variants: [],
});
expect(result.packs["pack-partial-2"]?.constraints).toEqual({
deliveryDays: { value: 7, operator: "LESS_THAN_OR_EQUAL" },
});
});
it("handles partial constraints using only coverage percentages", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-partial-3",
name: "Pack Partial 3",
billingId: "billing-pack-partial-3",
"constraints.blackCoveragePercentage": "90.5",
"constraints.colourCoveragePercentage": "60.25",
}),
],
variants: [],
});
expect(result.packs["pack-partial-3"]?.constraints).toEqual({
blackCoveragePercentage: { value: 90.5, operator: "LESS_THAN_OR_EQUAL" },
colourCoveragePercentage: {
value: 60.25,
operator: "LESS_THAN_OR_EQUAL",
},
});
});
it("parses assembly with only envelopeId", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-envelope-only",
name: "Pack Envelope Only",
billingId: "billing-pack-envelope-only",
"assembly.envelopeId": "envelope-123",
}),
],
variants: [],
});
expect(result.packs["pack-envelope-only"]?.assembly).toEqual({
envelopeId: "envelope-123",
});
});
it("parses assembly with only printColour", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-print-only",
name: "Pack Print Only",
billingId: "billing-pack-print-only",
"assembly.printColour": "BLACK",
}),
],
variants: [],
});
expect(result.packs["pack-print-only"]?.assembly).toEqual({
printColour: "BLACK",
});
});
it("throws when postage.id is missing but postage.size is present", () => {
expect(() =>
parseWorkbook({
packs: [
makePackRow({
id: "pack-missing-id",
name: "Pack Missing ID",
billingId: "billing-pack-missing-id",
"postage.id": undefined,
"postage.size": "STANDARD",
}),
],
variants: [],
}),
).toThrow(/Missing required postage fields.*pack-missing-id/);
});
it("throws when postage.size is missing but postage.id is present", () => {
expect(() =>
parseWorkbook({
packs: [
makePackRow({
id: "pack-missing-size",
name: "Pack Missing Size",
billingId: "billing-pack-missing-size",
"postage.id": "postage-1",
"postage.size": undefined,
}),
],
variants: [],
}),
).toThrow(/Missing required postage fields.*pack-missing-size/);
});
it("handles all assembly fields together", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-full-assembly",
name: "Pack Full Assembly",
billingId: "billing-pack-full-assembly",
"assembly.envelopeId": "env-1",
"assembly.printColour": "COLOUR",
"assembly.paper.id": "paper-1",
"assembly.paper.name": "Premium",
"assembly.paper.weightGSM": "100",
"assembly.paper.size": "A3",
"assembly.paper.colour": "WHITE",
"assembly.paper.recycled": "true",
"assembly.insertIds": "insert-a,insert-b",
"assembly.features": "BRAILLE,AUDIO,ADMAIL",
"assembly.additional": '{"note":"test"}',
}),
],
variants: [],
});
const { assembly } = result.packs["pack-full-assembly"];
expect(assembly?.envelopeId).toBe("env-1");
expect(assembly?.printColour).toBe("COLOUR");
expect(assembly?.paper?.id).toBe("paper-1");
expect(assembly?.insertIds).toEqual(["insert-a", "insert-b"]);
expect(assembly?.features).toEqual(["BRAILLE", "AUDIO", "ADMAIL"]);
expect(assembly?.additional).toEqual({ note: "test" });
});
it("parses arrays with whitespace correctly", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-whitespace-arrays",
name: "Pack Whitespace Arrays",
billingId: "billing-pack-whitespace-arrays",
"assembly.insertIds": " insert-1 , insert-2 , insert-3 ",
"assembly.features": " BRAILLE , AUDIO ",
}),
],
variants: [],
});
expect(result.packs["pack-whitespace-arrays"]?.assembly?.insertIds).toEqual(
["insert-1", "insert-2", "insert-3"],
);
expect(result.packs["pack-whitespace-arrays"]?.assembly?.features).toEqual([
"BRAILLE",
"AUDIO",
]);
});
it("handles empty insertIds but valid features", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-empty-inserts",
name: "Pack Empty Inserts",
billingId: "billing-pack-empty-inserts",
"assembly.insertIds": " ",
"assembly.features": "BRAILLE",
}),
],
variants: [],
});
expect(
result.packs["pack-empty-inserts"]?.assembly?.insertIds,
).toBeUndefined();
expect(result.packs["pack-empty-inserts"]?.assembly?.features).toEqual([
"BRAILLE",
]);
});
it("handles valid insertIds but empty features", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-empty-features",
name: "Pack Empty Features",
billingId: "billing-pack-empty-features",
"assembly.insertIds": "insert-1",
"assembly.features": " ",
}),
],
variants: [],
});
expect(result.packs["pack-empty-features"]?.assembly?.insertIds).toEqual([
"insert-1",
]);
expect(
result.packs["pack-empty-features"]?.assembly?.features,
).toBeUndefined();
});
it("parses Excel serial date numbers for timestamps", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-excel-dates",
name: "Pack with Excel Serial Dates",
createdAt: 44_927,
updatedAt: 44_958,
billingId: "billing-pack-excel-dates",
}),
],
variants: [],
});
expect(result.packs["pack-excel-dates"]?.createdAt).toMatch(/2023-01-01/);
expect(result.packs["pack-excel-dates"]?.updatedAt).toMatch(/2023-02-01/);
});
it("parses constraints.sides on PackSpecification", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-sides",
name: "Pack with Sides Constraint",
billingId: "billing-pack-with-sides",
"constraints.sheets": "10",
"constraints.sides": "20",
"constraints.deliveryDays": "5",
}),
],
variants: [],
});
expect(result.packs["pack-with-sides"]?.constraints).toEqual({
sheets: { value: 10, operator: "LESS_THAN_OR_EQUAL" },
sides: { value: 20, operator: "LESS_THAN_OR_EQUAL" },
deliveryDays: { value: 5, operator: "LESS_THAN_OR_EQUAL" },
});
});
it("parses assembly.paper.finish", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-with-paper-finish",
name: "Pack with Paper Finish",
billingId: "billing-pack-with-paper-finish",
"assembly.paper.id": "paper-glossy",
"assembly.paper.name": "Glossy Paper",
"assembly.paper.weightGSM": "120",
"assembly.paper.size": "A4",
"assembly.paper.colour": "WHITE",
"assembly.paper.recycled": "true",
"assembly.paper.finish": "GLOSSY",
}),
],
variants: [],
});
expect(result.packs["pack-with-paper-finish"]?.assembly?.paper).toEqual({
id: "paper-glossy",
name: "Glossy Paper",
weightGSM: 120,
size: "A4",
colour: "WHITE",
recycled: true,
finish: "GLOSSY",
});
});
it("parses assembly.paper without finish", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-without-paper-finish",
name: "Pack without Paper Finish",
billingId: "billing-pack-without-paper-finish",
"assembly.paper.id": "paper-plain",
"assembly.paper.name": "Plain Paper",
"assembly.paper.weightGSM": "80",
"assembly.paper.size": "A4",
"assembly.paper.colour": "WHITE",
"assembly.paper.recycled": "false",
}),
],
variants: [],
});
expect(result.packs["pack-without-paper-finish"]?.assembly?.paper).toEqual({
id: "paper-plain",
name: "Plain Paper",
weightGSM: 80,
size: "A4",
colour: "WHITE",
recycled: false,
});
expect(
result.packs["pack-without-paper-finish"]?.assembly?.paper?.finish,
).toBeUndefined();
});
it("defaults paper.colour to WHITE when missing", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-without-paper-colour",
name: "Pack without Paper Colour",
billingId: "billing-pack-without-paper-colour",
"assembly.paper.id": "paper-default-colour",
"assembly.paper.name": "Paper Default Colour",
"assembly.paper.weightGSM": "80",
"assembly.paper.size": "A4",
"assembly.paper.recycled": "false",
}),
],
variants: [],
});
expect(
result.packs["pack-without-paper-colour"]?.assembly?.paper?.colour,
).toBe("WHITE");
});
it("leaves pack constraints undefined when none are provided", () => {
const result = parseWorkbook({
packs: [
makePackRow({
id: "pack-no-constraints",
name: "Pack No Constraints",
billingId: "billing-pack-no-constraints",
}),
],
variants: [
makeVariantRow({
id: "variant-no-constraints",
volumeGroupId: "volume-group-nc",
packSpecificationIds: "pack-no-constraints",
}),
],
volumeGroups: [
{
id: "volume-group-nc",
name: "VolumeGroup NC",
startDate: "2025-01-01",
status: "PROD",
},
],
});
expect(result.packs["pack-no-constraints"]?.constraints).toBeUndefined();
});
});