Skip to content

Commit

Permalink
fix: order confirmation shipping component not being displayed (#18066)
Browse files Browse the repository at this point in the history
CXSPA-5254

Checking deliveryPointOfService property value has been made more flexible.
  • Loading branch information
FollowTheFlo authored Nov 8, 2023
1 parent 0aedaae commit 847448b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,39 @@ describe('OrderConfirmationShippingComponent', () => {
});
});

describe('use Order with different deliveryPointOfService value', () => {
class MockOrderFacade implements Partial<OrderFacade> {
getOrderDetails = createSpy().and.returnValue(
of({
entries: [
{
entryNumber: 1,
quantity: 1,
deliveryPointOfService: null,
},
],
deliveryAddress: { id: 'testAddress' },
deliveryMode: { code: 'testCode' },
})
);
}
function configureTestingModule(): TestBed {
return TestBed.configureTestingModule({
imports: [I18nTestingModule, PromotionsModule],
declarations: [OrderConfirmationShippingComponent],
providers: [{ provide: OrderFacade, useClass: MockOrderFacade }],
});
}
beforeEach(() => {
configureTestingModule();
stubSeviceAndCreateComponent();
});
it('should get entries when deliveryPointOfService is null', () => {
fixture.detectChanges();
expect(component.entries?.length).toEqual(1);
});
});

describe('Use outlet with outlet context data', () => {
const context$ = of({
showItemList: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class OrderConfirmationShippingComponent implements OnInit, OnDestroy {
.pipe(
tap((order) => {
this.entries = order?.entries?.filter(
(entry) => entry.deliveryPointOfService === undefined
(entry) => !entry.deliveryPointOfService
);
})
);
Expand Down

0 comments on commit 847448b

Please sign in to comment.