Skip to content

Commit

Permalink
refactor: remove log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Sep 4, 2024
1 parent 9da979f commit 08cf065
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 0 additions & 2 deletions views/frontend/checkout-core/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ createPdkCheckout({

const shippingClass = getHighestShippingClass();

console.log(shippingClass, shippingMethods);

return shippingClass !== undefined && shippingMethods.includes(shippingClass);

Check warning on line 59 in views/frontend/checkout-core/src/main.ts

View check run for this annotation

Codecov / codecov/patch

views/frontend/checkout-core/src/main.ts#L49-L59

Added lines #L49 - L59 were not covered by tests
},

Expand Down
13 changes: 4 additions & 9 deletions views/frontend/checkout-delivery-options/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import '../assets/scss/index.scss';
import {defaultGetPackageType} from '@myparcel-pdk/checkout-delivery-options';
import {
PdkDeliveryOptionsEvent,
initializeCheckoutDeliveryOptions as initialize,
useEvent,
usePdkCheckout,
updateContext,
useCheckoutStore,
getPackageTypeFromShippingMethod,
StoreListener,
getPackageTypeFromShippingMethod,
defaultGetPackageType,
updateContext,

Check warning on line 11 in views/frontend/checkout-delivery-options/src/main.ts

View check run for this annotation

Codecov / codecov/patch

views/frontend/checkout-delivery-options/src/main.ts#L7-L11

Added lines #L7 - L11 were not covered by tests
} from '@myparcel-pdk/checkout';
import {getHighestShippingClass} from './utils';

Check warning on line 13 in views/frontend/checkout-delivery-options/src/main.ts

View check run for this annotation

Codecov / codecov/patch

views/frontend/checkout-delivery-options/src/main.ts#L13

Added line #L13 was not covered by tests

Expand All @@ -20,18 +20,13 @@ const initializeCheckoutDeliveryOptions = () => {
return;
}

const context = await updateContext();

console.log('updated context:', context.settings.highestShippingClass);
console.log('getHighestShippingClass', getHighestShippingClass());
await updateContext();
});

initialize({
getPackageType() {
const shippingClass = getHighestShippingClass();

console.log('getPackageType', shippingClass, shippingClass && getPackageTypeFromShippingMethod(shippingClass));

return shippingClass ? getPackageTypeFromShippingMethod(shippingClass) : defaultGetPackageType();
},
});

Check warning on line 32 in views/frontend/checkout-delivery-options/src/main.ts

View check run for this annotation

Codecov / codecov/patch

views/frontend/checkout-delivery-options/src/main.ts#L16-L32

Added lines #L16 - L32 were not covered by tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {useCheckoutStore} from '@myparcel-pdk/checkout';
export const getHighestShippingClass = (): undefined | string => {
const checkout = useCheckoutStore();

console.log(checkout.state.context.settings);
// Empty string is a valid value, so we need to check for undefined
return checkout.state.context.settings.highestShippingClass || undefined;
};

Check warning on line 8 in views/frontend/checkout-delivery-options/src/utils/getHighestShippingClass.ts

View check run for this annotation

Codecov / codecov/patch

views/frontend/checkout-delivery-options/src/utils/getHighestShippingClass.ts#L2-L8

Added lines #L2 - L8 were not covered by tests

0 comments on commit 08cf065

Please sign in to comment.