Skip to content

Commit 986c800

Browse files
committed
chore(test): fix parser_helpers tests wrt types
1 parent a102817 commit 986c800

File tree

1 file changed

+43
-11
lines changed

1 file changed

+43
-11
lines changed

test/parser_helpers.test.ts

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,9 @@ describe("findAndUpsertIngredient", () => {
396396
name: "eggs",
397397
quantities: [
398398
{
399-
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
399+
groupQuantity: {
400+
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
401+
},
400402
},
401403
],
402404
};
@@ -412,7 +414,12 @@ describe("findAndUpsertIngredient", () => {
412414
name: "eggs",
413415
quantities: [
414416
{
415-
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
417+
groupQuantity: {
418+
quantity: {
419+
type: "fixed",
420+
value: { type: "decimal", decimal: 1 },
421+
},
422+
},
416423
},
417424
],
418425
},
@@ -421,7 +428,9 @@ describe("findAndUpsertIngredient", () => {
421428
name: "eggs",
422429
quantities: [
423430
{
424-
quantity: { type: "fixed", value: { type: "decimal", decimal: 2 } },
431+
groupQuantity: {
432+
quantity: { type: "fixed", value: { type: "decimal", decimal: 2 } },
433+
},
425434
},
426435
],
427436
};
@@ -430,7 +439,9 @@ describe("findAndUpsertIngredient", () => {
430439
);
431440
expect(ingredients[0]!.quantities).toEqual([
432441
{
433-
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
442+
groupQuantity: {
443+
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
444+
},
434445
},
435446
]);
436447

@@ -448,7 +459,9 @@ describe("findAndUpsertIngredient", () => {
448459
name: "eggs",
449460
quantities: [
450461
{
451-
quantity: { type: "fixed", value: { type: "text", text: "one" } },
462+
groupQuantity: {
463+
quantity: { type: "fixed", value: { type: "text", text: "one" } },
464+
},
452465
},
453466
],
454467
},
@@ -457,7 +470,9 @@ describe("findAndUpsertIngredient", () => {
457470
name: "eggs",
458471
quantities: [
459472
{
460-
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
473+
groupQuantity: {
474+
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
475+
},
461476
},
462477
],
463478
};
@@ -473,7 +488,12 @@ describe("findAndUpsertIngredient", () => {
473488
name: "eggs",
474489
quantities: [
475490
{
476-
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
491+
groupQuantity: {
492+
quantity: {
493+
type: "fixed",
494+
value: { type: "decimal", decimal: 1 },
495+
},
496+
},
477497
},
478498
],
479499
},
@@ -482,8 +502,13 @@ describe("findAndUpsertIngredient", () => {
482502
name: "unreferenced-ingredient",
483503
quantities: [
484504
{
485-
quantity: { type: "fixed", value: { type: "decimal", decimal: 100 } },
486-
unit: "g",
505+
groupQuantity: {
506+
quantity: {
507+
type: "fixed",
508+
value: { type: "decimal", decimal: 100 },
509+
},
510+
unit: "g",
511+
},
487512
},
488513
],
489514
flags: [],
@@ -501,7 +526,12 @@ describe("findAndUpsertIngredient", () => {
501526
name: "eggs",
502527
quantities: [
503528
{
504-
quantity: { type: "fixed", value: { type: "decimal", decimal: 1 } },
529+
groupQuantity: {
530+
quantity: {
531+
type: "fixed",
532+
value: { type: "decimal", decimal: 1 },
533+
},
534+
},
505535
},
506536
],
507537
flags: ["hidden"],
@@ -511,7 +541,9 @@ describe("findAndUpsertIngredient", () => {
511541
name: "eggs",
512542
quantities: [
513543
{
514-
quantity: { type: "fixed", value: { type: "decimal", decimal: 2 } },
544+
groupQuantity: {
545+
quantity: { type: "fixed", value: { type: "decimal", decimal: 2 } },
546+
},
515547
},
516548
],
517549
};

0 commit comments

Comments
 (0)