Skip to content

Commit

Permalink
fix: unit test of currency shop
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraLpresta committed Oct 4, 2024
1 parent ac55825 commit 01cb747
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions _dev/apps/ui/src/providers/shipping-rate-provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ describe('Product Feed / Step 2 Option 1 / Estimate Shipping', () => {
},
},
];
const transform = toApi(validCarrierFromView);
const currencyShop = 'EUR';
const transform = toApi(validCarrierFromView, currencyShop);

expect(transform).toEqual([
{
Expand All @@ -169,7 +170,7 @@ describe('Product Feed / Step 2 Option 1 / Estimate Shipping', () => {
minDeliveryTime: 5,
maxDeliveryTime: 7,
countries: [],
currency: '',
currency: 'EUR',
freeShippingOverAmount: {
shippingCost: 0,
orderPrice: 0,
Expand Down Expand Up @@ -199,7 +200,8 @@ describe('Product Feed / Step 2 Option 1 / Estimate Shipping', () => {
},
},
];
const transform = toApi(validCarrierFromView);
const currencyShop = 'EUR';
const transform = toApi(validCarrierFromView, currencyShop);

expect(transform).toEqual([
{
Expand All @@ -208,7 +210,7 @@ describe('Product Feed / Step 2 Option 1 / Estimate Shipping', () => {
minDeliveryTime: 5,
maxDeliveryTime: 7,
countries: [],
currency: '',
currency: 'EUR',
freeShippingOverAmount: {
shippingCost: 2.99,
orderPrice: 42.99,
Expand All @@ -221,7 +223,7 @@ describe('Product Feed / Step 2 Option 1 / Estimate Shipping', () => {
});

it('should return an empty array if estimateCarriers is empty', () => {
const transform = toApi([]);
const transform = toApi([], '');

expect(transform).toEqual([]);
});
Expand Down

0 comments on commit 01cb747

Please sign in to comment.