-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
1,093 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...s/order/components/order-details/order-overview/order-orverview-component.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
import { OrderOverviewComponentService } from './order-overview-component.service'; | ||
import { Order } from '@spartacus/order/root'; | ||
|
||
describe('OrderOverviewComponentService', () => { | ||
let service: OrderOverviewComponentService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [OrderOverviewComponentService], | ||
}); | ||
service = TestBed.inject(OrderOverviewComponentService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
it('should return true if delivery mode is defined', () => { | ||
const order: Order = { | ||
deliveryMode: { code: 'd1' }, | ||
}; | ||
expect(service.shouldShowDeliveryMode(order?.deliveryMode)).toEqual(true); | ||
}); | ||
it('should return false if delivery mode is not defined', () => { | ||
const order: Order = {}; | ||
expect(service.shouldShowDeliveryMode(order?.deliveryMode)).toEqual(false); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
...re-libs/order/components/order-details/order-overview/order-overview-component.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { Injectable } from '@angular/core'; | ||
import { DeliveryMode } from '@spartacus/cart/base/root'; | ||
|
||
@Injectable() | ||
export class OrderOverviewComponentService { | ||
shouldShowDeliveryMode(mode: DeliveryMode | undefined): boolean { | ||
return mode !== undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.