Skip to content

Commit

Permalink
Merge branch 'epic/b2b-commerce-quotes' into feature/CXSPA-4922
Browse files Browse the repository at this point in the history
  • Loading branch information
Uli-Tiger committed Oct 19, 2023
2 parents d595583 + 1c2b5a9 commit bcdee29
Show file tree
Hide file tree
Showing 104 changed files with 894 additions and 509 deletions.
9 changes: 6 additions & 3 deletions core-libs/setup/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,18 @@
"../../feature-libs/qualtrics/root/public_api"
],
"@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"],
"@spartacus/quote/components/aware": [
"../../feature-libs/quote/components/aware/public_api"
],
"@spartacus/quote/components": [
"../../feature-libs/quote/components/public_api"
],
"@spartacus/quote/components/request-button": [
"../../feature-libs/quote/components/request-button/public_api"
],
"@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"],
"@spartacus/quote": ["../../feature-libs/quote/public_api"],
"@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"],
"@spartacus/quote/quote-aware": [
"../../feature-libs/quote/quote-aware/public_api"
],
"@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"],
"@spartacus/requested-delivery-date/assets": [
"../../feature-libs/requested-delivery-date/assets/public_api"
Expand Down
9 changes: 6 additions & 3 deletions feature-libs/asm/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,18 @@
"../../feature-libs/qualtrics/root/public_api"
],
"@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"],
"@spartacus/quote/components/aware": [
"../../feature-libs/quote/components/aware/public_api"
],
"@spartacus/quote/components": [
"../../feature-libs/quote/components/public_api"
],
"@spartacus/quote/components/request-button": [
"../../feature-libs/quote/components/request-button/public_api"
],
"@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"],
"@spartacus/quote": ["../../feature-libs/quote/public_api"],
"@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"],
"@spartacus/quote/quote-aware": [
"../../feature-libs/quote/quote-aware/public_api"
],
"@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"],
"@spartacus/requested-delivery-date/assets": [
"../../feature-libs/requested-delivery-date/assets/public_api"
Expand Down
2 changes: 0 additions & 2 deletions feature-libs/cart/base/root/models/cart.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ export interface CartItemComponentOptions {

export interface OrderEntry {
orderCode?: string;
//TODO CHHI Where to put this? Depends on the library dependencies
//between cart, quote and product-configurator
quoteCode?: string;
basePrice?: Price;
deliveryMode?: DeliveryMode;
Expand Down
9 changes: 6 additions & 3 deletions feature-libs/cart/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,18 @@
"../../feature-libs/qualtrics/root/public_api"
],
"@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"],
"@spartacus/quote/components/aware": [
"../../feature-libs/quote/components/aware/public_api"
],
"@spartacus/quote/components": [
"../../feature-libs/quote/components/public_api"
],
"@spartacus/quote/components/request-button": [
"../../feature-libs/quote/components/request-button/public_api"
],
"@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"],
"@spartacus/quote": ["../../feature-libs/quote/public_api"],
"@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"],
"@spartacus/quote/quote-aware": [
"../../feature-libs/quote/quote-aware/public_api"
],
"@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"],
"@spartacus/requested-delivery-date/assets": [
"../../feature-libs/requested-delivery-date/assets/public_api"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class MockCardComponent {
content: Card;
@Input()
fitToContainer: boolean;
@Input()
index: number;
}

describe('B2BCheckoutDeliveryAddressComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
QueryState,
UserCostCenterService,
} from '@spartacus/core';
import { Card, PromotionsModule } from '@spartacus/storefront';
import { Card, OutletModule, PromotionsModule } from '@spartacus/storefront';
import { IconTestingModule } from 'projects/storefrontlib/cms-components/misc/icon/testing/icon-testing.module';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { B2BCheckoutReviewSubmitComponent } from './checkout-review-submit.component';
Expand Down Expand Up @@ -221,6 +221,7 @@ describe('B2BCheckoutReviewSubmitComponent', () => {
PromotionsModule,
RouterTestingModule,
IconTestingModule,
OutletModule,
],
declarations: [
B2BCheckoutReviewSubmitComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
} from '@spartacus/checkout/base/root';
import {
Address,
FeaturesConfig,
FeaturesConfigModule,
GlobalMessageService,
I18nTestingModule,
UserAddressService,
FeaturesConfig,
FeaturesConfigModule,
} from '@spartacus/core';
import { Card } from '@spartacus/storefront';
import { EMPTY, of } from 'rxjs';
Expand Down Expand Up @@ -92,6 +92,7 @@ class MockAddressFormComponent {
@Input() cancelBtnLabel: string;
@Input() showTitleCode: boolean;
@Input() setAsDefaultField: boolean;
@Input() addressData: Address;
}

@Component({
Expand All @@ -111,6 +112,8 @@ class MockCardComponent {
content: Card;
@Input()
fitToContainer: boolean;
@Input()
index: number;
}

class MockCheckoutDeliveryModesFacade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '@spartacus/cart/base/root';
import { CheckoutDeliveryModesFacade } from '@spartacus/checkout/base/root';
import {
FeaturesConfigModule,
GlobalMessageService,
GlobalMessageType,
I18nTestingModule,
Expand Down Expand Up @@ -118,7 +119,12 @@ describe('CheckoutDeliveryModeComponent', () => {
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ReactiveFormsModule, I18nTestingModule, OutletModule],
imports: [
ReactiveFormsModule,
I18nTestingModule,
OutletModule,
FeaturesConfigModule,
],
declarations: [CheckoutDeliveryModeComponent, MockSpinnerComponent],
providers: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { CheckoutDeliveryModeComponent } from './checkout-delivery-mode.componen
OutletModule,
PageComponentModule,
FeaturesConfigModule,
FeaturesConfigModule,
],
providers: [
provideDefaultConfig(<CmsConfig>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
FormErrorsModule,
ICON_TYPE,
LaunchDialogService,
NgSelectA11yModule,
} from '@spartacus/storefront';
import { EMPTY, Observable, of } from 'rxjs';
import { CheckoutPaymentFormComponent } from './checkout-payment-form.component';
Expand Down Expand Up @@ -180,6 +181,7 @@ describe('CheckoutPaymentFormComponent', () => {
imports: [
ReactiveFormsModule,
NgSelectModule,
NgSelectA11yModule,
I18nTestingModule,
FormErrorsModule,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ class MockPaymentFormComponent {
paymentMethodsCount: number;
@Input()
setAsDefaultField: boolean;
@Input()
loading: boolean;
@Input()
paymentDetails?: PaymentDetails;
}

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { Pipe, PipeTransform } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
import { I18nTestingModule, RoutingService } from '@spartacus/core';
import {
GlobalMessageService,
I18nTestingModule,
RoutingService,
} from '@spartacus/core';
import { OrderFacade } from '@spartacus/order/root';
import { LaunchDialogService, LAUNCH_CALLER } from '@spartacus/storefront';
import {
AtMessageModule,
LaunchDialogService,
LAUNCH_CALLER,
} from '@spartacus/storefront';
import { of } from 'rxjs';
import { CheckoutPlaceOrderComponent } from './checkout-place-order.component';
import createSpy = jasmine.createSpy;
Expand Down Expand Up @@ -42,12 +50,18 @@ describe('CheckoutPlaceOrderComponent', () => {
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ReactiveFormsModule, RouterTestingModule, I18nTestingModule],
imports: [
ReactiveFormsModule,
RouterTestingModule,
I18nTestingModule,
AtMessageModule,
],
declarations: [MockUrlPipe, CheckoutPlaceOrderComponent],
providers: [
{ provide: OrderFacade, useClass: MockOrderFacade },
{ provide: RoutingService, useClass: MockRoutingService },
{ provide: LaunchDialogService, useClass: MockLaunchDialogService },
{ provide: GlobalMessageService, useValue: {} },
],
}).compileComponents();
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
CheckoutStepType,
} from '@spartacus/checkout/base/root';
import { Address, Country, I18nTestingModule } from '@spartacus/core';
import { Card, PromotionsModule } from '@spartacus/storefront';
import { Card, OutletModule, PromotionsModule } from '@spartacus/storefront';
import { IconTestingModule } from 'projects/storefrontlib/cms-components/misc/icon/testing/icon-testing.module';
import { of } from 'rxjs';
import { CheckoutStepService } from '../services/checkout-step.service';
Expand Down Expand Up @@ -149,6 +149,7 @@ describe('CheckoutReviewSubmitComponent', () => {
PromotionsModule,
RouterTestingModule,
IconTestingModule,
OutletModule,
],
declarations: [
CheckoutReviewSubmitComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import {
CmsConfig,
FeaturesConfigModule,
I18nModule,
provideDefaultConfig,
UrlModule,
Expand All @@ -33,6 +34,7 @@ import { CheckoutReviewSubmitComponent } from './checkout-review-submit.componen
PromotionsModule,
IconModule,
OutletModule,
FeaturesConfigModule,
],
providers: [
provideDefaultConfig(<CmsConfig>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ import { IconTestingModule } from 'projects/storefrontlib/cms-components/misc/ic
import { of } from 'rxjs';
import createSpy = jasmine.createSpy;

import { ChangeDetectorRef, Pipe, PipeTransform } from '@angular/core';
import {
ChangeDetectorRef,
Component,
Input,
Pipe,
PipeTransform,
} from '@angular/core';
import {
ActiveCartFacade,
DeliveryMode,
OrderEntry,
} from '@spartacus/cart/base/root';
import { Card, OutletModule } from '@spartacus/storefront';
import { CheckoutStepService } from '../../services/checkout-step.service';
import { CheckoutReviewShippingComponent } from './checkout-review-shipping.component';

Expand Down Expand Up @@ -107,14 +114,38 @@ class MockUrlPipe implements PipeTransform {
transform(): any {}
}

@Component({
selector: 'cx-card',
template: '',
})
class MockCardComponent {
@Input()
border: boolean;
@Input()
content: Card;
@Input()
fitToContainer: boolean;
@Input()
index: number;
}

describe('CheckoutReviewShippingComponent', () => {
let component: CheckoutReviewShippingComponent;
let fixture: ComponentFixture<CheckoutReviewShippingComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [I18nTestingModule, RouterTestingModule, IconTestingModule],
declarations: [CheckoutReviewShippingComponent, MockUrlPipe],
imports: [
I18nTestingModule,
RouterTestingModule,
IconTestingModule,
OutletModule,
],
declarations: [
CheckoutReviewShippingComponent,
MockUrlPipe,
MockCardComponent,
],
providers: [
{
provide: CheckoutDeliveryAddressFacade,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { Pipe, PipeTransform } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
import { I18nTestingModule, RoutingService } from '@spartacus/core';
import {
GlobalMessageService,
I18nTestingModule,
RoutingService,
} from '@spartacus/core';
import {
DaysOfWeek,
OrderFacade,
Expand All @@ -11,7 +15,11 @@ import {
ScheduledReplenishmentOrderFacade,
ScheduleReplenishmentForm,
} from '@spartacus/order/root';
import { LaunchDialogService, LAUNCH_CALLER } from '@spartacus/storefront';
import {
AtMessageModule,
LaunchDialogService,
LAUNCH_CALLER,
} from '@spartacus/storefront';
import { BehaviorSubject, EMPTY, of } from 'rxjs';
import { CheckoutReplenishmentFormService } from '../services/checkout-replenishment-form.service';
import { CheckoutScheduledReplenishmentPlaceOrderComponent } from './checkout-place-order.component';
Expand Down Expand Up @@ -85,7 +93,12 @@ describe('CheckoutScheduledReplenishmentPlaceOrderComponent', () => {
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ReactiveFormsModule, RouterTestingModule, I18nTestingModule],
imports: [
ReactiveFormsModule,
RouterTestingModule,
I18nTestingModule,
AtMessageModule,
],
declarations: [
MockUrlPipe,
CheckoutScheduledReplenishmentPlaceOrderComponent,
Expand All @@ -102,6 +115,10 @@ describe('CheckoutScheduledReplenishmentPlaceOrderComponent', () => {
provide: ScheduledReplenishmentOrderFacade,
useClass: MockScheduledReplenishmentOrderFacade,
},
{
provide: GlobalMessageService,
useValue: {},
},
],
}).compileComponents();
})
Expand Down
9 changes: 6 additions & 3 deletions feature-libs/checkout/tsconfig.schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,18 @@
"../../feature-libs/qualtrics/root/public_api"
],
"@spartacus/quote/assets": ["../../feature-libs/quote/assets/public_api"],
"@spartacus/quote/components/aware": [
"../../feature-libs/quote/components/aware/public_api"
],
"@spartacus/quote/components": [
"../../feature-libs/quote/components/public_api"
],
"@spartacus/quote/components/request-button": [
"../../feature-libs/quote/components/request-button/public_api"
],
"@spartacus/quote/core": ["../../feature-libs/quote/core/public_api"],
"@spartacus/quote": ["../../feature-libs/quote/public_api"],
"@spartacus/quote/occ": ["../../feature-libs/quote/occ/public_api"],
"@spartacus/quote/quote-aware": [
"../../feature-libs/quote/quote-aware/public_api"
],
"@spartacus/quote/root": ["../../feature-libs/quote/root/public_api"],
"@spartacus/requested-delivery-date/assets": [
"../../feature-libs/requested-delivery-date/assets/public_api"
Expand Down
Loading

0 comments on commit bcdee29

Please sign in to comment.