Skip to content

Commit

Permalink
feat(cart): set shipping method id in magento driver (#2839)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Jun 7, 2024
1 parent 91738c4 commit cd823ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { TestBed } from '@angular/core/testing';

import { DaffCartShippingRate } from '@daffodil/cart';
import { MagentoCartShippingMethod } from '@daffodil/cart/driver/magento';
import { MagentoCartShippingMethodFactory } from '@daffodil/cart/driver/magento/testing';

import { DaffMagentoCartShippingRateTransformer } from './cart-shipping-rate.service';
Expand All @@ -9,7 +11,7 @@ describe('@daffodil/cart/driver/magento | Transformer | MagentoCartShippingRate'

let magentoShippingMethodFactory: MagentoCartShippingMethodFactory;

let mockMagentoShippingMethod;
let mockMagentoShippingMethod: MagentoCartShippingMethod;

beforeEach(() => {
TestBed.configureTestingModule({
Expand All @@ -30,7 +32,7 @@ describe('@daffodil/cart/driver/magento | Transformer | MagentoCartShippingRate'
});

describe('transform | transforming a cart shipping rate', () => {
let transformedCartShippingRate;
let transformedCartShippingRate: DaffCartShippingRate;
let carrier;
let price;

Expand All @@ -47,6 +49,7 @@ describe('@daffodil/cart/driver/magento | Transformer | MagentoCartShippingRate'
it('should return an object with the correct values', () => {
expect(transformedCartShippingRate.carrier).toEqual(carrier);
expect(transformedCartShippingRate.price).toEqual(price);
expect(transformedCartShippingRate.id).toEqual(mockMagentoShippingMethod.method_code);
});

describe('when the argument is null', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class DaffMagentoCartShippingRateTransformer {
price: shippingMethod.amount.value,
method_code: shippingMethod.method_code,
method_title: shippingMethod.method_title,
id: shippingMethod.method_code,

// TODO: implement
id: null,
method_description: null,
} : null;
}
Expand Down

0 comments on commit cd823ad

Please sign in to comment.