"
class="cx-replenishment-order-history-value"
>
- {{ order?.trigger.displayTimeTable | slice: 0:-12 }}
+ {{ order?.trigger.displayTimeTable | slice: 0 : -12 }}
@@ -179,9 +172,7 @@
params: order
} | cxUrl
"
- class="
- cx-replenishment-order-history-value cx-next-order-date
- "
+ class="cx-replenishment-order-history-value cx-next-order-date"
>
{{
order?.active
diff --git a/feature-libs/order/components/replenishment-order-history/replenishment-order-history.component.spec.ts b/feature-libs/order/components/replenishment-order-history/replenishment-order-history.component.spec.ts
index 93ce5cde082..ed615087629 100644
--- a/feature-libs/order/components/replenishment-order-history/replenishment-order-history.component.spec.ts
+++ b/feature-libs/order/components/replenishment-order-history/replenishment-order-history.component.spec.ts
@@ -122,36 +122,34 @@ describe('ReplenishmentOrderHistoryComponent', () => {
let launchDialogService: LaunchDialogService;
let el: DebugElement;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [RouterTestingModule, I18nTestingModule],
- declarations: [
- ReplenishmentOrderHistoryComponent,
- MockUrlPipe,
- MockPaginationComponent,
- MockSortingComponent,
- ],
- providers: [
- { provide: RoutingService, useClass: MockRoutingService },
- {
- provide: ReplenishmentOrderHistoryFacade,
- useClass: MockReplenishmentOrderHistoryFacade,
- },
- {
- provide: LaunchDialogService,
- useClass: MockLaunchDialogService,
- },
- ],
- }).compileComponents();
-
- replenishmentOrderHistoryFacade = TestBed.inject(
- ReplenishmentOrderHistoryFacade
- );
- routingService = TestBed.inject(RoutingService);
- launchDialogService = TestBed.inject(LaunchDialogService);
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ imports: [RouterTestingModule, I18nTestingModule],
+ declarations: [
+ ReplenishmentOrderHistoryComponent,
+ MockUrlPipe,
+ MockPaginationComponent,
+ MockSortingComponent,
+ ],
+ providers: [
+ { provide: RoutingService, useClass: MockRoutingService },
+ {
+ provide: ReplenishmentOrderHistoryFacade,
+ useClass: MockReplenishmentOrderHistoryFacade,
+ },
+ {
+ provide: LaunchDialogService,
+ useClass: MockLaunchDialogService,
+ },
+ ],
+ }).compileComponents();
+
+ replenishmentOrderHistoryFacade = TestBed.inject(
+ ReplenishmentOrderHistoryFacade
+ );
+ routingService = TestBed.inject(RoutingService);
+ launchDialogService = TestBed.inject(LaunchDialogService);
+ }));
beforeEach(() => {
fixture = TestBed.createComponent(ReplenishmentOrderHistoryComponent);
diff --git a/feature-libs/order/components/return-request-detail/return-request-items/return-request-items.component.spec.ts b/feature-libs/order/components/return-request-detail/return-request-items/return-request-items.component.spec.ts
index 3cc511ceeab..f7731462c4a 100644
--- a/feature-libs/order/components/return-request-detail/return-request-items/return-request-items.component.spec.ts
+++ b/feature-libs/order/components/return-request-detail/return-request-items/return-request-items.component.spec.ts
@@ -30,21 +30,19 @@ describe('ReturnRequestItemsComponent', () => {
let component: ReturnRequestItemsComponent;
let fixture: ComponentFixture;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [I18nTestingModule],
- declarations: [
- ReturnRequestItemsComponent,
- MockMediaComponent,
- MockFeatureLevelDirective,
- ],
- providers: [
- { provide: ReturnRequestService, useClass: MockCheckoutService },
- ],
- }).compileComponents();
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ imports: [I18nTestingModule],
+ declarations: [
+ ReturnRequestItemsComponent,
+ MockMediaComponent,
+ MockFeatureLevelDirective,
+ ],
+ providers: [
+ { provide: ReturnRequestService, useClass: MockCheckoutService },
+ ],
+ }).compileComponents();
+ }));
beforeEach(() => {
fixture = TestBed.createComponent(ReturnRequestItemsComponent);
diff --git a/feature-libs/order/components/return-request-detail/return-request-overview/return-request-overview.component.spec.ts b/feature-libs/order/components/return-request-detail/return-request-overview/return-request-overview.component.spec.ts
index 9e93588c550..bbd38c9268c 100644
--- a/feature-libs/order/components/return-request-detail/return-request-overview/return-request-overview.component.spec.ts
+++ b/feature-libs/order/components/return-request-detail/return-request-overview/return-request-overview.component.spec.ts
@@ -27,17 +27,15 @@ describe('ReturnRequestOverviewComponent', () => {
let fixture: ComponentFixture;
let returnRequestService: ReturnRequestService;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [I18nTestingModule],
- declarations: [ReturnRequestOverviewComponent],
- providers: [
- { provide: ReturnRequestService, useClass: MockReturnRequestService },
- ],
- }).compileComponents();
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ imports: [I18nTestingModule],
+ declarations: [ReturnRequestOverviewComponent],
+ providers: [
+ { provide: ReturnRequestService, useClass: MockReturnRequestService },
+ ],
+ }).compileComponents();
+ }));
beforeEach(() => {
fixture = TestBed.createComponent(ReturnRequestOverviewComponent);
diff --git a/feature-libs/order/components/return-request-detail/return-request-totals/return-request-totals.component.spec.ts b/feature-libs/order/components/return-request-detail/return-request-totals/return-request-totals.component.spec.ts
index c9b1dbef074..cc7a7ab6172 100644
--- a/feature-libs/order/components/return-request-detail/return-request-totals/return-request-totals.component.spec.ts
+++ b/feature-libs/order/components/return-request-detail/return-request-totals/return-request-totals.component.spec.ts
@@ -21,17 +21,15 @@ describe('ReturnRequestTotalsComponent', () => {
let component: ReturnRequestTotalsComponent;
let fixture: ComponentFixture;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [I18nTestingModule],
- declarations: [ReturnRequestTotalsComponent],
- providers: [
- { provide: ReturnRequestService, useClass: MockReturnRequestService },
- ],
- }).compileComponents();
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ imports: [I18nTestingModule],
+ declarations: [ReturnRequestTotalsComponent],
+ providers: [
+ { provide: ReturnRequestService, useClass: MockReturnRequestService },
+ ],
+ }).compileComponents();
+ }));
beforeEach(() => {
fixture = TestBed.createComponent(ReturnRequestTotalsComponent);
diff --git a/feature-libs/order/components/return-request-list/order-return-request-list.component.spec.ts b/feature-libs/order/components/return-request-list/order-return-request-list.component.spec.ts
index 8a9afa5e332..e311a7b9df8 100644
--- a/feature-libs/order/components/return-request-list/order-return-request-list.component.spec.ts
+++ b/feature-libs/order/components/return-request-list/order-return-request-list.component.spec.ts
@@ -61,26 +61,24 @@ describe('OrderReturnRequestListComponent', () => {
let fixture: ComponentFixture;
let returnService: OrderReturnRequestFacade;
let el: DebugElement;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [RouterTestingModule, ListNavigationModule, I18nTestingModule],
- declarations: [OrderReturnRequestListComponent, MockUrlPipe],
- providers: [
- {
- provide: OrderReturnRequestFacade,
- useClass: MockOrderReturnRequestService,
- },
- {
- provide: TranslationService,
- useClass: MockTranslationService,
- },
- ],
- }).compileComponents();
-
- returnService = TestBed.inject(OrderReturnRequestFacade);
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ imports: [RouterTestingModule, ListNavigationModule, I18nTestingModule],
+ declarations: [OrderReturnRequestListComponent, MockUrlPipe],
+ providers: [
+ {
+ provide: OrderReturnRequestFacade,
+ useClass: MockOrderReturnRequestService,
+ },
+ {
+ provide: TranslationService,
+ useClass: MockTranslationService,
+ },
+ ],
+ }).compileComponents();
+
+ returnService = TestBed.inject(OrderReturnRequestFacade);
+ }));
beforeEach(() => {
fixture = TestBed.createComponent(OrderReturnRequestListComponent);
diff --git a/feature-libs/order/core/connectors/reorder-order.connector.spec.ts b/feature-libs/order/core/connectors/reorder-order.connector.spec.ts
index 5de179f3349..148a3591990 100644
--- a/feature-libs/order/core/connectors/reorder-order.connector.spec.ts
+++ b/feature-libs/order/core/connectors/reorder-order.connector.spec.ts
@@ -21,19 +21,17 @@ describe('ReorderOrderConnector', () => {
let adapter: ReorderOrderAdapter;
let connector: ReorderOrderConnector;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- providers: [
- ReorderOrderConnector,
- {
- provide: ReorderOrderAdapter,
- useClass: MockReorderOrderAdapter,
- },
- ],
- });
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ providers: [
+ ReorderOrderConnector,
+ {
+ provide: ReorderOrderAdapter,
+ useClass: MockReorderOrderAdapter,
+ },
+ ],
+ });
+ }));
beforeEach(() => {
adapter = TestBed.inject(ReorderOrderAdapter);
diff --git a/feature-libs/order/core/connectors/scheduled-replenishment-order.connector.spec.ts b/feature-libs/order/core/connectors/scheduled-replenishment-order.connector.spec.ts
index 2b4db43c3c4..a4b5b81e889 100644
--- a/feature-libs/order/core/connectors/scheduled-replenishment-order.connector.spec.ts
+++ b/feature-libs/order/core/connectors/scheduled-replenishment-order.connector.spec.ts
@@ -30,19 +30,17 @@ describe('Scheduled Replenishment Order Connector', () => {
let adapter: ScheduledReplenishmentOrderAdapter;
let connector: ScheduledReplenishmentOrderConnector;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- providers: [
- ScheduledReplenishmentOrderConnector,
- {
- provide: ScheduledReplenishmentOrderAdapter,
- useClass: MockScheduledReplenishmentOrderAdapter,
- },
- ],
- });
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ providers: [
+ ScheduledReplenishmentOrderConnector,
+ {
+ provide: ScheduledReplenishmentOrderAdapter,
+ useClass: MockScheduledReplenishmentOrderAdapter,
+ },
+ ],
+ });
+ }));
beforeEach(() => {
adapter = TestBed.inject(ScheduledReplenishmentOrderAdapter);
diff --git a/feature-libs/order/core/facade/my-account-v2-order-history.service.ts b/feature-libs/order/core/facade/my-account-v2-order-history.service.ts
index 9e71b9e7b09..fc782bd4f0b 100644
--- a/feature-libs/order/core/facade/my-account-v2-order-history.service.ts
+++ b/feature-libs/order/core/facade/my-account-v2-order-history.service.ts
@@ -147,7 +147,7 @@ export class MyAccountV2OrderHistoryService {
(
responses: [
OrderHistoryListView | undefined,
- ReturnRequestList | undefined
+ ReturnRequestList | undefined,
]
) => {
const returnRequests = responses?.[1]?.returnRequests;
diff --git a/feature-libs/order/occ/adapters/converters/occ-reorder-order-normalizer.spec.ts b/feature-libs/order/occ/adapters/converters/occ-reorder-order-normalizer.spec.ts
index 33e429567a5..6a240ab98f2 100644
--- a/feature-libs/order/occ/adapters/converters/occ-reorder-order-normalizer.spec.ts
+++ b/feature-libs/order/occ/adapters/converters/occ-reorder-order-normalizer.spec.ts
@@ -15,19 +15,17 @@ describe('OccReorderOrderNormalizer', () => {
let normalizer: OccReorderOrderNormalizer;
let converter: ConverterService;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- providers: [
- OccReorderOrderNormalizer,
- {
- provide: ConverterService,
- useClass: MockConverterService,
- },
- ],
- });
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ providers: [
+ OccReorderOrderNormalizer,
+ {
+ provide: ConverterService,
+ useClass: MockConverterService,
+ },
+ ],
+ });
+ }));
beforeEach(() => {
normalizer = TestBed.inject(OccReorderOrderNormalizer);
diff --git a/feature-libs/order/occ/adapters/converters/occ-replenishment-order-normalizer.spec.ts b/feature-libs/order/occ/adapters/converters/occ-replenishment-order-normalizer.spec.ts
index 6495b62ec30..322651a09c6 100644
--- a/feature-libs/order/occ/adapters/converters/occ-replenishment-order-normalizer.spec.ts
+++ b/feature-libs/order/occ/adapters/converters/occ-replenishment-order-normalizer.spec.ts
@@ -22,19 +22,17 @@ describe('OccReplenishmentOrderNormalizer', () => {
let normalizer: OccReplenishmentOrderNormalizer;
let converter: ConverterService;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- providers: [
- OccReplenishmentOrderNormalizer,
- {
- provide: ConverterService,
- useClass: MockConverterService,
- },
- ],
- });
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ providers: [
+ OccReplenishmentOrderNormalizer,
+ {
+ provide: ConverterService,
+ useClass: MockConverterService,
+ },
+ ],
+ });
+ }));
beforeEach(() => {
normalizer = TestBed.inject(OccReplenishmentOrderNormalizer);
diff --git a/feature-libs/order/occ/adapters/converters/occ-return-request-normalizer.spec.ts b/feature-libs/order/occ/adapters/converters/occ-return-request-normalizer.spec.ts
index b8c59dfacbd..42b71128f35 100644
--- a/feature-libs/order/occ/adapters/converters/occ-return-request-normalizer.spec.ts
+++ b/feature-libs/order/occ/adapters/converters/occ-return-request-normalizer.spec.ts
@@ -17,7 +17,7 @@ describe('OccReturnRequestNormalizer', () => {
({
...product,
code: (product as Product).code + 'converted',
- } as any)
+ }) as any
);
});
diff --git a/feature-libs/order/occ/adapters/converters/occ-scheduled-replenishment-order-form-serializer.spec.ts b/feature-libs/order/occ/adapters/converters/occ-scheduled-replenishment-order-form-serializer.spec.ts
index 07265245480..8b401561735 100644
--- a/feature-libs/order/occ/adapters/converters/occ-scheduled-replenishment-order-form-serializer.spec.ts
+++ b/feature-libs/order/occ/adapters/converters/occ-scheduled-replenishment-order-form-serializer.spec.ts
@@ -8,13 +8,11 @@ const mockDate = '2021-06-01';
describe('OccScheduledReplenishmentOrderFormSerializer', () => {
let serializer: OccScheduledReplenishmentOrderFormSerializer;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- providers: [OccScheduledReplenishmentOrderFormSerializer],
- });
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ providers: [OccScheduledReplenishmentOrderFormSerializer],
+ });
+ }));
beforeEach(() => {
serializer = TestBed.inject(OccScheduledReplenishmentOrderFormSerializer);
diff --git a/feature-libs/order/occ/adapters/occ-order-history.adapter.spec.ts b/feature-libs/order/occ/adapters/occ-order-history.adapter.spec.ts
index 848b4a68c5c..70e0cf1b9fa 100644
--- a/feature-libs/order/occ/adapters/occ-order-history.adapter.spec.ts
+++ b/feature-libs/order/occ/adapters/occ-order-history.adapter.spec.ts
@@ -72,50 +72,38 @@ describe('OccOrderHistoryAdapter', () => {
});
describe('getUserOrders', () => {
- it(
- 'should fetch user Orders with default options',
- waitForAsync(() => {
- const PAGE_SIZE = 5;
- occOrderHistoryAdapter.loadHistory(userId, PAGE_SIZE).subscribe();
- httpMock.expectOne((req: HttpRequest) => {
- return req.method === 'GET';
- }, `GET method and url`);
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'orderHistory',
- {
- urlParams: { userId },
- queryParams: { pageSize: PAGE_SIZE.toString() },
- }
- );
- })
- );
+ it('should fetch user Orders with default options', waitForAsync(() => {
+ const PAGE_SIZE = 5;
+ occOrderHistoryAdapter.loadHistory(userId, PAGE_SIZE).subscribe();
+ httpMock.expectOne((req: HttpRequest) => {
+ return req.method === 'GET';
+ }, `GET method and url`);
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith('orderHistory', {
+ urlParams: { userId },
+ queryParams: { pageSize: PAGE_SIZE.toString() },
+ });
+ }));
- it(
- 'should fetch user Orders with defined options',
- waitForAsync(() => {
- const PAGE_SIZE = 5;
- const currentPage = 1;
- const sort = 'byDate';
+ it('should fetch user Orders with defined options', waitForAsync(() => {
+ const PAGE_SIZE = 5;
+ const currentPage = 1;
+ const sort = 'byDate';
- occOrderHistoryAdapter
- .loadHistory(userId, PAGE_SIZE, currentPage, sort)
- .subscribe();
- httpMock.expectOne((req: HttpRequest) => {
- return req.method === 'GET';
- }, `GET method`);
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'orderHistory',
- {
- urlParams: { userId },
- queryParams: {
- pageSize: PAGE_SIZE.toString(),
- currentPage: currentPage.toString(),
- sort,
- },
- }
- );
- })
- );
+ occOrderHistoryAdapter
+ .loadHistory(userId, PAGE_SIZE, currentPage, sort)
+ .subscribe();
+ httpMock.expectOne((req: HttpRequest) => {
+ return req.method === 'GET';
+ }, `GET method`);
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith('orderHistory', {
+ urlParams: { userId },
+ queryParams: {
+ pageSize: PAGE_SIZE.toString(),
+ currentPage: currentPage.toString(),
+ sort,
+ },
+ });
+ }));
it('should use converter', () => {
occOrderHistoryAdapter.loadHistory(userId).subscribe();
@@ -129,21 +117,15 @@ describe('OccOrderHistoryAdapter', () => {
});
describe('getOrder', () => {
- it(
- 'should fetch a single order',
- waitForAsync(() => {
- occOrderHistoryAdapter.load(userId, orderData.code).subscribe();
- httpMock.expectOne((req: HttpRequest) => {
- return req.method === 'GET';
- }, `GET a single order`);
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'orderDetail',
- {
- urlParams: { userId, orderId: orderData.code },
- }
- );
- })
- );
+ it('should fetch a single order', waitForAsync(() => {
+ occOrderHistoryAdapter.load(userId, orderData.code).subscribe();
+ httpMock.expectOne((req: HttpRequest) => {
+ return req.method === 'GET';
+ }, `GET a single order`);
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith('orderDetail', {
+ urlParams: { userId, orderId: orderData.code },
+ });
+ }));
it('should use converter', () => {
occOrderHistoryAdapter.load(userId, orderData.code).subscribe();
@@ -153,30 +135,27 @@ describe('OccOrderHistoryAdapter', () => {
});
describe('getConsignmentTracking', () => {
- it(
- 'should fetch a consignment tracking',
- waitForAsync(() => {
- const tracking: ConsignmentTracking = {
- trackingID: '1234567890',
- trackingEvents: [],
- };
- occOrderHistoryAdapter
- .getConsignmentTracking(orderData.code, consignmentCode, userId)
- .subscribe((result) => expect(result).toEqual(tracking));
- const mockReq = httpMock.expectOne((req) => {
- return req.method === 'GET';
- }, `GET a consignment tracking`);
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'consignmentTracking',
- {
- urlParams: { userId, orderCode: orderData.code, consignmentCode },
- }
- );
- expect(mockReq.cancelled).toBeFalsy();
- expect(mockReq.request.responseType).toEqual('json');
- mockReq.flush(tracking);
- })
- );
+ it('should fetch a consignment tracking', waitForAsync(() => {
+ const tracking: ConsignmentTracking = {
+ trackingID: '1234567890',
+ trackingEvents: [],
+ };
+ occOrderHistoryAdapter
+ .getConsignmentTracking(orderData.code, consignmentCode, userId)
+ .subscribe((result) => expect(result).toEqual(tracking));
+ const mockReq = httpMock.expectOne((req) => {
+ return req.method === 'GET';
+ }, `GET a consignment tracking`);
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
+ 'consignmentTracking',
+ {
+ urlParams: { userId, orderCode: orderData.code, consignmentCode },
+ }
+ );
+ expect(mockReq.cancelled).toBeFalsy();
+ expect(mockReq.request.responseType).toEqual('json');
+ mockReq.flush(tracking);
+ }));
it('should use converter', () => {
occOrderHistoryAdapter
@@ -194,70 +173,56 @@ describe('OccOrderHistoryAdapter', () => {
});
describe('cancel', () => {
- it(
- 'should be able to cancel an order',
- waitForAsync(() => {
- const cancelRequestInput: CancellationRequestEntryInputList = {
- cancellationRequestEntryInputs: [
- { orderEntryNumber: 0, quantity: 1 },
- ],
- };
+ it('should be able to cancel an order', waitForAsync(() => {
+ const cancelRequestInput: CancellationRequestEntryInputList = {
+ cancellationRequestEntryInputs: [{ orderEntryNumber: 0, quantity: 1 }],
+ };
- let result;
- occOrderHistoryAdapter
- .cancel(userId, orderData.code, cancelRequestInput)
- .subscribe((res) => (result = res));
+ let result;
+ occOrderHistoryAdapter
+ .cancel(userId, orderData.code, cancelRequestInput)
+ .subscribe((res) => (result = res));
- const mockReq = httpMock.expectOne((req) => {
- return req.method === 'POST';
- });
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'cancelOrder',
- {
- urlParams: { userId, orderId: orderData.code },
- }
- );
- expect(mockReq.cancelled).toBeFalsy();
- expect(mockReq.request.responseType).toEqual('json');
- mockReq.flush({});
- expect(result).toEqual({});
- })
- );
+ const mockReq = httpMock.expectOne((req) => {
+ return req.method === 'POST';
+ });
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith('cancelOrder', {
+ urlParams: { userId, orderId: orderData.code },
+ });
+ expect(mockReq.cancelled).toBeFalsy();
+ expect(mockReq.request.responseType).toEqual('json');
+ mockReq.flush({});
+ expect(result).toEqual({});
+ }));
});
describe('createReturnRequest', () => {
- it(
- 'should be able to create an order return request',
- waitForAsync(() => {
- const returnRequestInput: ReturnRequestEntryInputList = {
- orderCode: orderData.code,
- returnRequestEntryInputs: [{ orderEntryNumber: 0, quantity: 1 }],
- };
+ it('should be able to create an order return request', waitForAsync(() => {
+ const returnRequestInput: ReturnRequestEntryInputList = {
+ orderCode: orderData.code,
+ returnRequestEntryInputs: [{ orderEntryNumber: 0, quantity: 1 }],
+ };
- let result;
- occOrderHistoryAdapter
- .createReturnRequest(userId, returnRequestInput)
- .subscribe((res) => (result = res));
+ let result;
+ occOrderHistoryAdapter
+ .createReturnRequest(userId, returnRequestInput)
+ .subscribe((res) => (result = res));
- const mockReq = httpMock.expectOne((req) => {
- return req.method === 'POST';
- });
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'returnOrder',
- {
- urlParams: { userId },
- }
- );
- expect(mockReq.cancelled).toBeFalsy();
- expect(mockReq.request.responseType).toEqual('json');
- mockReq.flush(returnRequest);
- expect(result).toEqual(returnRequest);
- expect(converter.convert).toHaveBeenCalledWith(
- returnRequestInput,
- ORDER_RETURN_REQUEST_INPUT_SERIALIZER
- );
- })
- );
+ const mockReq = httpMock.expectOne((req) => {
+ return req.method === 'POST';
+ });
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith('returnOrder', {
+ urlParams: { userId },
+ });
+ expect(mockReq.cancelled).toBeFalsy();
+ expect(mockReq.request.responseType).toEqual('json');
+ mockReq.flush(returnRequest);
+ expect(result).toEqual(returnRequest);
+ expect(converter.convert).toHaveBeenCalledWith(
+ returnRequestInput,
+ ORDER_RETURN_REQUEST_INPUT_SERIALIZER
+ );
+ }));
it('should use converter', () => {
const returnRequestInput: ReturnRequestEntryInputList = {};
@@ -276,46 +241,37 @@ describe('OccOrderHistoryAdapter', () => {
});
describe('loadReturnRequestList', () => {
- it(
- 'should fetch order return request list with default options',
- waitForAsync(() => {
- occOrderHistoryAdapter.loadReturnRequestList(userId).subscribe();
- httpMock.expectOne((req: HttpRequest) => {
- return req.method === 'GET';
- });
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'orderReturns',
- { urlParams: { userId }, queryParams: {} }
- );
- })
- );
+ it('should fetch order return request list with default options', waitForAsync(() => {
+ occOrderHistoryAdapter.loadReturnRequestList(userId).subscribe();
+ httpMock.expectOne((req: HttpRequest) => {
+ return req.method === 'GET';
+ });
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith('orderReturns', {
+ urlParams: { userId },
+ queryParams: {},
+ });
+ }));
- it(
- 'should fetch user order return request list with defined options',
- waitForAsync(() => {
- const PAGE_SIZE = 5;
- const currentPage = 1;
- const sort = 'byDate';
+ it('should fetch user order return request list with defined options', waitForAsync(() => {
+ const PAGE_SIZE = 5;
+ const currentPage = 1;
+ const sort = 'byDate';
- occOrderHistoryAdapter
- .loadReturnRequestList(userId, PAGE_SIZE, currentPage, sort)
- .subscribe();
- httpMock.expectOne((req: HttpRequest) => {
- return req.method === 'GET';
- });
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'orderReturns',
- {
- urlParams: { userId },
- queryParams: {
- pageSize: PAGE_SIZE.toString(),
- currentPage: currentPage.toString(),
- sort,
- },
- }
- );
- })
- );
+ occOrderHistoryAdapter
+ .loadReturnRequestList(userId, PAGE_SIZE, currentPage, sort)
+ .subscribe();
+ httpMock.expectOne((req: HttpRequest) => {
+ return req.method === 'GET';
+ });
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith('orderReturns', {
+ urlParams: { userId },
+ queryParams: {
+ pageSize: PAGE_SIZE.toString(),
+ currentPage: currentPage.toString(),
+ sort,
+ },
+ });
+ }));
it('should use converter', () => {
occOrderHistoryAdapter.loadReturnRequestList(userId).subscribe();
@@ -329,28 +285,25 @@ describe('OccOrderHistoryAdapter', () => {
});
describe('loadReturnRequestDetail', () => {
- it(
- 'should be able to load an order return request data',
- waitForAsync(() => {
- let result;
- occOrderHistoryAdapter
- .loadReturnRequestDetail(userId, 'test')
- .subscribe((res) => (result = res));
+ it('should be able to load an order return request data', waitForAsync(() => {
+ let result;
+ occOrderHistoryAdapter
+ .loadReturnRequestDetail(userId, 'test')
+ .subscribe((res) => (result = res));
- const mockReq = httpMock.expectOne((req) => {
- return req.method === 'GET';
- });
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'orderReturnDetail',
- {
- urlParams: { userId, returnRequestCode: 'test' },
- }
- );
- expect(mockReq.cancelled).toBeFalsy();
- mockReq.flush({});
- expect(result).toEqual({});
- })
- );
+ const mockReq = httpMock.expectOne((req) => {
+ return req.method === 'GET';
+ });
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
+ 'orderReturnDetail',
+ {
+ urlParams: { userId, returnRequestCode: 'test' },
+ }
+ );
+ expect(mockReq.cancelled).toBeFalsy();
+ mockReq.flush({});
+ expect(result).toEqual({});
+ }));
it('should use converter', () => {
occOrderHistoryAdapter
@@ -368,28 +321,22 @@ describe('OccOrderHistoryAdapter', () => {
});
describe('cancelReturnRequest', () => {
- it(
- 'should be able to cancel one return request',
- waitForAsync(() => {
- let result;
- occOrderHistoryAdapter
- .cancelReturnRequest(userId, 'returnCode', { status: 'CANCELLING' })
- .subscribe((res) => (result = res));
+ it('should be able to cancel one return request', waitForAsync(() => {
+ let result;
+ occOrderHistoryAdapter
+ .cancelReturnRequest(userId, 'returnCode', { status: 'CANCELLING' })
+ .subscribe((res) => (result = res));
- const mockReq = httpMock.expectOne((req) => {
- return req.method === 'PATCH';
- });
- expect(occEnpointsService.buildUrl).toHaveBeenCalledWith(
- 'cancelReturn',
- {
- urlParams: { userId, returnRequestCode: 'returnCode' },
- }
- );
- expect(mockReq.cancelled).toBeFalsy();
- expect(mockReq.request.responseType).toEqual('json');
- mockReq.flush({});
- expect(result).toEqual({});
- })
- );
+ const mockReq = httpMock.expectOne((req) => {
+ return req.method === 'PATCH';
+ });
+ expect(occEnpointsService.buildUrl).toHaveBeenCalledWith('cancelReturn', {
+ urlParams: { userId, returnRequestCode: 'returnCode' },
+ });
+ expect(mockReq.cancelled).toBeFalsy();
+ expect(mockReq.request.responseType).toEqual('json');
+ mockReq.flush({});
+ expect(result).toEqual({});
+ }));
});
});
diff --git a/feature-libs/order/occ/adapters/occ-reorder-order.adapter.spec.ts b/feature-libs/order/occ/adapters/occ-reorder-order.adapter.spec.ts
index d2e7e88c7ca..4a5612a8582 100644
--- a/feature-libs/order/occ/adapters/occ-reorder-order.adapter.spec.ts
+++ b/feature-libs/order/occ/adapters/occ-reorder-order.adapter.spec.ts
@@ -26,17 +26,15 @@ describe(`OccReorderOrderAdapter`, () => {
let converter: ConverterService;
let occEndpointService: OccEndpointsService;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [HttpClientTestingModule],
- providers: [
- OccReorderOrderAdapter,
- { provide: OccEndpointsService, useClass: MockOccEndpointsService },
- ],
- });
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ imports: [HttpClientTestingModule],
+ providers: [
+ OccReorderOrderAdapter,
+ { provide: OccEndpointsService, useClass: MockOccEndpointsService },
+ ],
+ });
+ }));
beforeEach(() => {
occAdapter = TestBed.inject(OccReorderOrderAdapter);
diff --git a/feature-libs/order/occ/adapters/occ-scheduled-replenishment-order.adapter.spec.ts b/feature-libs/order/occ/adapters/occ-scheduled-replenishment-order.adapter.spec.ts
index 01a45b77fa2..097e9b22cd4 100644
--- a/feature-libs/order/occ/adapters/occ-scheduled-replenishment-order.adapter.spec.ts
+++ b/feature-libs/order/occ/adapters/occ-scheduled-replenishment-order.adapter.spec.ts
@@ -82,18 +82,16 @@ describe(`OccScheduledReplenishmentOrderAdapter`, () => {
let httpMock: HttpTestingController;
let converter: ConverterService;
- beforeEach(
- waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [HttpClientTestingModule],
- providers: [
- OccScheduledReplenishmentOrderAdapter,
- { provide: OccConfig, useValue: MockOccModuleConfig },
- { provide: LoggerService, useClass: MockLoggerService },
- ],
- });
- })
- );
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ imports: [HttpClientTestingModule],
+ providers: [
+ OccScheduledReplenishmentOrderAdapter,
+ { provide: OccConfig, useValue: MockOccModuleConfig },
+ { provide: LoggerService, useClass: MockLoggerService },
+ ],
+ });
+ }));
beforeEach(() => {
occAdapter = TestBed.inject(OccScheduledReplenishmentOrderAdapter);
diff --git a/feature-libs/order/package.json b/feature-libs/order/package.json
index da20e1d8c54..1eb58117145 100644
--- a/feature-libs/order/package.json
+++ b/feature-libs/order/package.json
@@ -1,6 +1,6 @@
{
"name": "@spartacus/order",
- "version": "2211.24.1",
+ "version": "2211.25.0-3",
"description": "Order feature library for Spartacus",
"keywords": [
"spartacus",
@@ -33,13 +33,13 @@
"@ng-select/ng-select": "^12.0.4",
"@ngrx/effects": "^17.0.1",
"@ngrx/store": "^17.0.1",
- "@spartacus/cart": "2211.24.1",
- "@spartacus/core": "2211.24.1",
- "@spartacus/pdf-invoices": "2211.24.1",
- "@spartacus/schematics": "2211.24.1",
- "@spartacus/storefront": "2211.24.1",
- "@spartacus/styles": "2211.24.1",
- "@spartacus/user": "2211.24.1",
+ "@spartacus/cart": "2211.25.0-3",
+ "@spartacus/core": "2211.25.0-3",
+ "@spartacus/pdf-invoices": "2211.25.0-3",
+ "@spartacus/schematics": "2211.25.0-3",
+ "@spartacus/storefront": "2211.25.0-3",
+ "@spartacus/styles": "2211.25.0-3",
+ "@spartacus/user": "2211.25.0-3",
"rxjs": "^7.8.0"
},
"publishConfig": {
diff --git a/feature-libs/organization/account-summary/components/details/header/account-summary-header.component.html b/feature-libs/organization/account-summary/components/details/header/account-summary-header.component.html
index ccb24e41988..e5d3a02ad65 100644
--- a/feature-libs/organization/account-summary/components/details/header/account-summary-header.component.html
+++ b/feature-libs/organization/account-summary/components/details/header/account-summary-header.component.html
@@ -1,9 +1,7 @@
|