Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulofph committed Jan 25, 2024
1 parent b4d8d10 commit 3a1317d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/pricing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ describe('computeAggregatedAndPriceTotals', () => {
value: 0,
},
] as PriceInputMappings,
quantity: 0,
quantity: 1,
},
];

Expand Down Expand Up @@ -700,7 +700,7 @@ describe('computeAggregatedAndPriceTotals', () => {
value: 0,
},
] as PriceInputMappings,
quantity: 0,
quantity: 1,
},
];

Expand Down
4 changes: 0 additions & 4 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export const getPriceTiersForQuantity = (tiers: PriceTier[], quantity: number):
};

const getPriceTierForQuantity = (tiers: PriceTier[], quantity: number): PriceTier | null | undefined => {
console.log({ quantity });
const selectedTiers = tiers?.filter(byPriceTiersForQuantity(tiers, quantity));

if (selectedTiers?.length) {
Expand Down Expand Up @@ -181,10 +180,7 @@ export const computeTieredFlatFeePriceItemValues = (
isUsingPriceMappingToSelectTier: boolean,
unchangedPriceDisplayInJourneys: Price['price_display_in_journeys'],
): PriceItemsTotals => {
console.log('tiers', tiers);
console.log('quantityToSelectTier', quantityToSelectTier);
const tier = getPriceTierForQuantity(tiers, quantityToSelectTier);
console.log('tier', tier);
/**
* If the price mapping is used to select the tier, we need to multiply the totals by the quantity.
* Otherwise, the quantity is only used to select the tier.
Expand Down

0 comments on commit 3a1317d

Please sign in to comment.