diff --git a/.npmignore b/.npmignore index 3ba6feeee01..b7599e66bb7 100644 --- a/.npmignore +++ b/.npmignore @@ -2,3 +2,4 @@ sonar-project.properties sub-folder/ .pipeline/ +tmp/** diff --git a/.prettierrc b/.prettierrc index 544138be456..c1a6f667131 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,3 +1,4 @@ { - "singleQuote": true + "singleQuote": true, + "trailingComma": "es5" } diff --git a/ci-scripts/publish-sample-data.sh b/ci-scripts/publish-sample-data.sh index 45a9c403557..d2e418599bf 100755 --- a/ci-scripts/publish-sample-data.sh +++ b/ci-scripts/publish-sample-data.sh @@ -4,8 +4,12 @@ TAG_NAME="sampledata" SAMPLE_DATA_ASSETS_FOLDER="sample-data-assets" STOREFRONT_FILE_NAME="spartacussampledata" -SAMPLE_DATA_UNRELEASED_BRANCH="release/6.x" -UNRELEASED_SPARTACUS_VERSION_NAME="$STOREFRONT_FILE_NAME-version-6-x" + +SAMPLE_DATA_UNRELEASED_BRANCH="release/2211.x" +UNRELEASED_SPARTACUS_VERSION_NAME="$STOREFRONT_FILE_NAME-version-2211-x" + +SAMPLE_DATA_UNRELEASED_BRANCH6="release/6.x" +UNRELEASED_SPARTACUS_VERSION_NAME6="$STOREFRONT_FILE_NAME-version-6-x" SAMPLE_DATA_CURRENT_BRANCH="release/5.x" CURRENT_SPARTACUS_VERSION_NAME="$STOREFRONT_FILE_NAME-version-5-x" @@ -23,12 +27,17 @@ function download_sample_data_from_spartacussample_repo { } echo "-----" -echo "Downloading UNRELEASED sample data for 6.x" +echo "Downloading PREVIOUS sample data for 6.x" download_sample_data_from_spartacussample_repo $SAMPLE_DATA_UNRELEASED_BRANCH $UNRELEASED_SPARTACUS_VERSION_NAME echo "-----" -echo "Downloading CURRENT sample data for 5.x" +echo "Downloading PREVIOUS sample data for 6.x" + +download_sample_data_from_spartacussample_repo $SAMPLE_DATA_UNRELEASED_BRANCH6 $UNRELEASED_SPARTACUS_VERSION_NAME6 + +echo "-----" +echo "Downloading PREVIOUS sample data for 5.x" download_sample_data_from_spartacussample_repo $SAMPLE_DATA_CURRENT_BRANCH $CURRENT_SPARTACUS_VERSION_NAME @@ -55,7 +64,8 @@ echo "-----" echo "Create a release with created tag" gh release create $TAG_NAME ./$SAMPLE_DATA_ASSETS_FOLDER/** --repo "https://$GH_TOKEN@github.com/SAP-samples/cloud-commerce-sample-setup.git" --title "Spartacus Sample Data" --notes "Spartacus sample data releases: -6-x: unreleased -5-x: current release +2211-x: current release +6-x: previous release +5-x: previous release 4-x: previous release -3-x: old release" +3-x: old release" \ No newline at end of file diff --git a/ci-scripts/release-packer.sh b/ci-scripts/release-packer.sh index 690df6b02f4..17583a51e24 100755 --- a/ci-scripts/release-packer.sh +++ b/ci-scripts/release-packer.sh @@ -5,12 +5,15 @@ set -e shopt -s extglob dotglob +# Build all the libraries and generate the dist folders to use when releasing +function build_libs { + npm ci && npm run build:libs +} + # Configure the project to move everything into a sub-folder to keep root clean for publishing function configure_project { mkdir sub-folder mv !(sub-folder) sub-folder - cd sub-folder - npm ci && npm run build:libs } # Clear root containing the old package so the next package can be published @@ -49,6 +52,8 @@ function pack { if [[ $1 == 'configure' ]]; then configure_project +elif [[ $1 == 'build' ]]; then + build_libs else clear_root pack "$1" diff --git a/core-libs/setup/package.json b/core-libs/setup/package.json index 461e30ae105..4c04c20fb8b 100644 --- a/core-libs/setup/package.json +++ b/core-libs/setup/package.json @@ -1,6 +1,6 @@ { "name": "@spartacus/setup", - "version": "2211.24.1", + "version": "2211.25.0-3", "description": "Includes features that makes Spartacus and it's setup easier and streamlined.", "keywords": [ "spartacus", @@ -21,10 +21,10 @@ "peerDependencies": { "@angular/core": "^17.0.5", "@angular/ssr": "^17.0.5", - "@spartacus/cart": "2211.24.1", - "@spartacus/core": "2211.24.1", - "@spartacus/order": "2211.24.1", - "@spartacus/user": "2211.24.1" + "@spartacus/cart": "2211.25.0-3", + "@spartacus/core": "2211.25.0-3", + "@spartacus/order": "2211.25.0-3", + "@spartacus/user": "2211.25.0-3" }, "optionalDependencies": { "@angular/platform-server": "^17.0.5", diff --git a/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.html b/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.html index 38e9cde6b90..c407d368005 100644 --- a/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.html +++ b/feature-libs/asm/components/asm-create-customer-form/asm-create-customer-form.component.html @@ -102,19 +102,13 @@
{{ 'productDetails.noReviews' | cxTranslate }} diff --git a/projects/storefrontlib/cms-components/product/product-intro/product-intro.component.spec.ts b/projects/storefrontlib/cms-components/product/product-intro/product-intro.component.spec.ts index a0346b6d4b2..9415326f1c1 100644 --- a/projects/storefrontlib/cms-components/product/product-intro/product-intro.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-intro/product-intro.component.spec.ts @@ -10,6 +10,7 @@ import { ComponentCreateEvent, ComponentDestroyEvent, } from '@spartacus/storefront'; +import { MockFeatureDirective } from 'projects/storefrontlib/shared/test/mock-feature-directive'; import { EMPTY, Observable, of } from 'rxjs'; import { CurrentProductService } from '../current-product.service'; import { ProductIntroComponent } from './product-intro.component'; @@ -47,28 +48,30 @@ describe('ProductIntroComponent in product', () => { let translationService: TranslationService; let eventService: EventService; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [I18nTestingModule], - declarations: [ProductIntroComponent, MockStarRatingComponent], - providers: [ - { - provide: CurrentProductService, - useClass: MockCurrentProductService, - }, - { - provide: TranslationService, - useClass: MockTranslationService, - }, - { - provide: EventService, - useClass: MockEventService, - }, - ], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [I18nTestingModule], + declarations: [ + ProductIntroComponent, + MockStarRatingComponent, + MockFeatureDirective, + ], + providers: [ + { + provide: CurrentProductService, + useClass: MockCurrentProductService, + }, + { + provide: TranslationService, + useClass: MockTranslationService, + }, + { + provide: EventService, + useClass: MockEventService, + }, + ], + }).compileComponents(); + })); beforeEach(() => { translationService = TestBed.inject(TranslationService); @@ -213,7 +216,7 @@ describe('ProductIntroComponent in product', () => { productIntroComponent.product$ = of({ averageRating: 5, } as Product); - productIntroComponent['getReviewsComponent'] = () => ({} as HTMLElement); + productIntroComponent['getReviewsComponent'] = () => ({}) as HTMLElement; fixture.detectChanges(); expect(fixture.debugElement.nativeElement.innerText).toContain( @@ -253,7 +256,7 @@ describe('ProductIntroComponent in product', () => { productIntroComponent.product$ = of({ averageRating: 4, } as Product); - productIntroComponent['getReviewsComponent'] = () => ({} as HTMLElement); + productIntroComponent['getReviewsComponent'] = () => ({}) as HTMLElement; fixture.detectChanges(); expect(fixture.debugElement.nativeElement.innerText).not.toContain( diff --git a/projects/storefrontlib/cms-components/product/product-intro/product-intro.module.ts b/projects/storefrontlib/cms-components/product/product-intro/product-intro.module.ts index 0c11a2cd209..12baebf8782 100644 --- a/projects/storefrontlib/cms-components/product/product-intro/product-intro.module.ts +++ b/projects/storefrontlib/cms-components/product/product-intro/product-intro.module.ts @@ -6,12 +6,17 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { CmsConfig, I18nModule, provideDefaultConfig } from '@spartacus/core'; +import { + CmsConfig, + FeaturesConfigModule, + I18nModule, + provideDefaultConfig, +} from '@spartacus/core'; import { StarRatingModule } from '../../../shared/components/star-rating/star-rating.module'; import { ProductIntroComponent } from './product-intro.component'; @NgModule({ - imports: [CommonModule, I18nModule, StarRatingModule], + imports: [CommonModule, I18nModule, StarRatingModule, FeaturesConfigModule], providers: [ provideDefaultConfig({ cmsComponents: { diff --git a/projects/storefrontlib/cms-components/product/product-list/container/product-list.component.spec.ts b/projects/storefrontlib/cms-components/product/product-list/container/product-list.component.spec.ts index 36669525e1a..fa764292bf0 100644 --- a/projects/storefrontlib/cms-components/product/product-list/container/product-list.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-list/container/product-list.component.spec.ts @@ -101,52 +101,50 @@ describe('ProductListComponent', () => { let fixture: ComponentFixture; let componentService: ProductListComponentService; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [ - ListNavigationModule, - FormsModule, - RouterTestingModule, - I18nTestingModule, - InfiniteScrollModule, - SpinnerModule, - ], - providers: [ - { - provide: PageLayoutService, - useClass: MockPageLayoutService, - }, - { - provide: ProductListComponentService, - useClass: MockProductListComponentService, - }, - { - provide: ViewConfig, - useClass: MockViewConfig, - }, - { - provide: GlobalMessageService, - useClass: MockGlobalMessageService, - }, - ], - declarations: [ - ProductListComponent, - ProductFacetNavigationComponent, - ProductGridItemComponent, - MockStarRatingComponent, - MockAddToCartComponent, - MediaComponent, - ProductViewComponent, - MockProductListItemComponent, - MockUrlPipe, - MockCxIconComponent, - ProductScrollComponent, - MockFeatureLevelDirective, - ], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + ListNavigationModule, + FormsModule, + RouterTestingModule, + I18nTestingModule, + InfiniteScrollModule, + SpinnerModule, + ], + providers: [ + { + provide: PageLayoutService, + useClass: MockPageLayoutService, + }, + { + provide: ProductListComponentService, + useClass: MockProductListComponentService, + }, + { + provide: ViewConfig, + useClass: MockViewConfig, + }, + { + provide: GlobalMessageService, + useClass: MockGlobalMessageService, + }, + ], + declarations: [ + ProductListComponent, + ProductFacetNavigationComponent, + ProductGridItemComponent, + MockStarRatingComponent, + MockAddToCartComponent, + MediaComponent, + ProductViewComponent, + MockProductListItemComponent, + MockUrlPipe, + MockCxIconComponent, + ProductScrollComponent, + MockFeatureLevelDirective, + ], + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductListComponent); diff --git a/projects/storefrontlib/cms-components/product/product-list/container/product-scroll/product-scroll.component.spec.ts b/projects/storefrontlib/cms-components/product/product-list/container/product-scroll/product-scroll.component.spec.ts index 1e4e33634d0..c71bfcdae5c 100644 --- a/projects/storefrontlib/cms-components/product/product-list/container/product-scroll/product-scroll.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-list/container/product-scroll/product-scroll.component.spec.ts @@ -159,35 +159,33 @@ describe('ProductScrollComponent', () => { let fixture: ComponentFixture; let el: DebugElement; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [ - ProductScrollComponent, - ProductGridItemComponent, - MockProductListItemComponent, - MockUrlPipe, - MediaComponent, - MockStarRatingComponent, - MockAddToCartComponent, - MockStyleIconsComponent, - MockFeatureLevelDirective, - ], - imports: [ - InfiniteScrollModule, - I18nTestingModule, - SpinnerModule, - RouterTestingModule, - ], - providers: [ - { - provide: ProductListComponentService, - useClass: MockProductListComponentService, - }, - ], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ + ProductScrollComponent, + ProductGridItemComponent, + MockProductListItemComponent, + MockUrlPipe, + MediaComponent, + MockStarRatingComponent, + MockAddToCartComponent, + MockStyleIconsComponent, + MockFeatureLevelDirective, + ], + imports: [ + InfiniteScrollModule, + I18nTestingModule, + SpinnerModule, + RouterTestingModule, + ], + providers: [ + { + provide: ProductListComponentService, + useClass: MockProductListComponentService, + }, + ], + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductScrollComponent); diff --git a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/active-facets/active-facets.component.spec.ts b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/active-facets/active-facets.component.spec.ts index 4ad1d611b9a..44b559d18cc 100644 --- a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/active-facets/active-facets.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/active-facets/active-facets.component.spec.ts @@ -36,19 +36,17 @@ describe('ActiveFacetsComponent', () => { let fixture: ComponentFixture; let element: DebugElement; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [I18nTestingModule, RouterTestingModule, KeyboardFocusModule], - declarations: [ActiveFacetsComponent, MockCxIconComponent], - providers: [{ provide: FacetService, useClass: MockFacetService }], - }) - .overrideComponent(ActiveFacetsComponent, { - set: { changeDetection: ChangeDetectionStrategy.Default }, - }) - .compileComponents(); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [I18nTestingModule, RouterTestingModule, KeyboardFocusModule], + declarations: [ActiveFacetsComponent, MockCxIconComponent], + providers: [{ provide: FacetService, useClass: MockFacetService }], }) - ); + .overrideComponent(ActiveFacetsComponent, { + set: { changeDetection: ChangeDetectionStrategy.Default }, + }) + .compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ActiveFacetsComponent); diff --git a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/facet-list/facet-list.component.spec.ts b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/facet-list/facet-list.component.spec.ts index 340738b531a..ac18db865dd 100644 --- a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/facet-list/facet-list.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/facet-list/facet-list.component.spec.ts @@ -72,33 +72,31 @@ describe('FacetListComponent', () => { let focusService: KeyboardFocusService; let featureConfigService: FeatureConfigService; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [I18nTestingModule, RouterTestingModule], - declarations: [ - FacetListComponent, - MockIconComponent, - MockFacetComponent, - MockKeyboadFocusDirective, - MockFeatureDirective, - ], - providers: [ - { provide: FacetService, useClass: MockFacetService }, - { - provide: FeaturesConfig, - useValue: { - features: { level: '5.1' }, - }, + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [I18nTestingModule, RouterTestingModule], + declarations: [ + FacetListComponent, + MockIconComponent, + MockFacetComponent, + MockKeyboadFocusDirective, + MockFeatureDirective, + ], + providers: [ + { provide: FacetService, useClass: MockFacetService }, + { + provide: FeaturesConfig, + useValue: { + features: { level: '5.1' }, }, - ], - }) - .overrideComponent(FacetListComponent, { - set: { changeDetection: ChangeDetectionStrategy.Default }, - }) - .compileComponents(); + }, + ], }) - ); + .overrideComponent(FacetListComponent, { + set: { changeDetection: ChangeDetectionStrategy.Default }, + }) + .compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(FacetListComponent); diff --git a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/facet/facet.component.html b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/facet/facet.component.html index 2fdaa8dd28c..a5ed01f9a8f 100644 --- a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/facet/facet.component.html +++ b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/facet/facet.component.html @@ -18,7 +18,7 @@
{ let element: DebugElement; let facetService: FacetService; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [I18nTestingModule, RouterTestingModule], - declarations: [ - FacetComponent, - MockCxIconComponent, - MockKeyboadFocusDirective, - ], - providers: [ - { provide: FacetService, useClass: MockFacetService }, - { provide: FeatureConfigService, useClass: MockFeatureConfigService }, - ], - }) - .overrideComponent(FacetComponent, { - set: { changeDetection: ChangeDetectionStrategy.Default }, - }) - .compileComponents(); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [I18nTestingModule, RouterTestingModule], + declarations: [ + FacetComponent, + MockCxIconComponent, + MockKeyboadFocusDirective, + ], + providers: [ + { provide: FacetService, useClass: MockFacetService }, + { provide: FeatureConfigService, useClass: MockFeatureConfigService }, + ], }) - ); + .overrideComponent(FacetComponent, { + set: { changeDetection: ChangeDetectionStrategy.Default }, + }) + .compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(FacetComponent); diff --git a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/product-facet-navigation.component.spec.ts b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/product-facet-navigation.component.spec.ts index 5ecae26839f..0ddafcee408 100644 --- a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/product-facet-navigation.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/product-facet-navigation.component.spec.ts @@ -47,25 +47,23 @@ describe('ProductFacetNavigationComponent', () => { let fixture: ComponentFixture; let element: DebugElement; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [I18nTestingModule], - declarations: [ - ProductFacetNavigationComponent, - MockActiveFacetsComponent, - MockFacetListComponent, - MockCxIconComponent, - ], - providers: [ - { - provide: BreakpointService, - useClass: MockBreakpointService, - }, - ], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [I18nTestingModule], + declarations: [ + ProductFacetNavigationComponent, + MockActiveFacetsComponent, + MockFacetListComponent, + MockCxIconComponent, + ], + providers: [ + { + provide: BreakpointService, + useClass: MockBreakpointService, + }, + ], + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductFacetNavigationComponent); @@ -78,16 +76,13 @@ describe('ProductFacetNavigationComponent', () => { }); describe('mobile', () => { - it( - 'should not have facet list when trigger button is visible', - waitForAsync(async () => { - await fixture.whenStable(); - fixture.detectChanges(); + it('should not have facet list when trigger button is visible', waitForAsync(async () => { + await fixture.whenStable(); + fixture.detectChanges(); - const facetList = element.query(By.css('cx-facet-list')); - expect(facetList).toBeNull(); - }) - ); + const facetList = element.query(By.css('cx-facet-list')); + expect(facetList).toBeNull(); + })); it('should invoke launch when trigger button is clicked', () => { spyOn(component, 'launch'); @@ -97,61 +92,46 @@ describe('ProductFacetNavigationComponent', () => { expect(component.launch).toHaveBeenCalled(); }); - it( - 'should have facet list after trigger button is clicked', - waitForAsync(async () => { - fixture.detectChanges(); - const button: HTMLElement = element.query( - By.css('button') - ).nativeElement; - button.click(); - - await fixture.whenStable(); - fixture.detectChanges(); - - const facetList = element.query(By.css('cx-facet-list')).nativeElement; - expect(facetList).toBeTruthy(); - }) - ); - - it( - 'should invoke close when closeList is emitted', - waitForAsync(async () => { - spyOn(component, 'close'); - fixture.detectChanges(); - const button: HTMLElement = element.query( - By.css('button') - ).nativeElement; - button.click(); - - await fixture.whenStable(); - fixture.detectChanges(); - - const facetList = element.query(By.css('cx-facet-list')).nativeElement; - facetList.dispatchEvent(new Event('closeList')); - - expect(component.close).toHaveBeenCalled(); - }) - ); + it('should have facet list after trigger button is clicked', waitForAsync(async () => { + fixture.detectChanges(); + const button: HTMLElement = element.query(By.css('button')).nativeElement; + button.click(); + + await fixture.whenStable(); + fixture.detectChanges(); + + const facetList = element.query(By.css('cx-facet-list')).nativeElement; + expect(facetList).toBeTruthy(); + })); + + it('should invoke close when closeList is emitted', waitForAsync(async () => { + spyOn(component, 'close'); + fixture.detectChanges(); + const button: HTMLElement = element.query(By.css('button')).nativeElement; + button.click(); + + await fixture.whenStable(); + fixture.detectChanges(); + + const facetList = element.query(By.css('cx-facet-list')).nativeElement; + facetList.dispatchEvent(new Event('closeList')); + + expect(component.close).toHaveBeenCalled(); + })); }); describe('desktop', () => { - it( - 'should have facet list when trigger button is hidden', - waitForAsync(async () => { - fixture.detectChanges(); - - const button: HTMLElement = element.query( - By.css('button') - ).nativeElement; - button.style.display = 'none'; - - await fixture.whenStable(); - fixture.detectChanges(); - - const facetList = element.query(By.css('cx-facet-list')).nativeElement; - expect(facetList).toBeTruthy(); - }) - ); + it('should have facet list when trigger button is hidden', waitForAsync(async () => { + fixture.detectChanges(); + + const button: HTMLElement = element.query(By.css('button')).nativeElement; + button.style.display = 'none'; + + await fixture.whenStable(); + fixture.detectChanges(); + + const facetList = element.query(By.css('cx-facet-list')).nativeElement; + expect(facetList).toBeTruthy(); + })); }); }); diff --git a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/services/product-facet.service.ts b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/services/product-facet.service.ts index 8b4800c510f..946d5759876 100644 --- a/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/services/product-facet.service.ts +++ b/projects/storefrontlib/cms-components/product/product-list/product-facet-navigation/services/product-facet.service.ts @@ -63,7 +63,7 @@ export class ProductFacetService { ({ facets: result.facets, activeFacets: result.breadcrumbs, - } as FacetList) + }) as FacetList ) ); diff --git a/projects/storefrontlib/cms-components/product/product-list/product-grid-item/product-grid-item.component.spec.ts b/projects/storefrontlib/cms-components/product/product-list/product-grid-item/product-grid-item.component.spec.ts index f4d05a569d3..31198c4f758 100644 --- a/projects/storefrontlib/cms-components/product/product-list/product-grid-item/product-grid-item.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-list/product-grid-item/product-grid-item.component.spec.ts @@ -94,37 +94,35 @@ describe('ProductGridItemComponent in product-list', () => { }, }; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule, I18nTestingModule, OutletModule], - declarations: [ - ProductGridItemComponent, - MockMediaComponent, - MockAddToCartComponent, - MockStarRatingComponent, - MockUrlPipe, - MockCxIconComponent, - MockFeatureLevelDirective, - MockOutletDirective, - ], - providers: [ - { - provide: RoutingService, - useClass: MockRoutingService, - }, - { - provide: ProductService, - useClass: MockProductService, - }, - ], - }) - .overrideComponent(ProductGridItemComponent, { - set: { changeDetection: ChangeDetectionStrategy.Default }, - }) - .compileComponents(); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [RouterTestingModule, I18nTestingModule, OutletModule], + declarations: [ + ProductGridItemComponent, + MockMediaComponent, + MockAddToCartComponent, + MockStarRatingComponent, + MockUrlPipe, + MockCxIconComponent, + MockFeatureLevelDirective, + MockOutletDirective, + ], + providers: [ + { + provide: RoutingService, + useClass: MockRoutingService, + }, + { + provide: ProductService, + useClass: MockProductService, + }, + ], }) - ); + .overrideComponent(ProductGridItemComponent, { + set: { changeDetection: ChangeDetectionStrategy.Default }, + }) + .compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductGridItemComponent); diff --git a/projects/storefrontlib/cms-components/product/product-list/product-list-item/product-list-item.component.spec.ts b/projects/storefrontlib/cms-components/product/product-list/product-list-item/product-list-item.component.spec.ts index 6f262a30e91..f258e010d30 100644 --- a/projects/storefrontlib/cms-components/product/product-list/product-list-item/product-list-item.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-list/product-list-item/product-list-item.component.spec.ts @@ -94,37 +94,35 @@ describe('ProductListItemComponent in product-list', () => { }, }; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule, I18nTestingModule, OutletModule], - declarations: [ - ProductListItemComponent, - MockPictureComponent, - MockAddToCartComponent, - MockStarRatingComponent, - MockUrlPipe, - MockCxIconComponent, - MockFeatureDirective, - MockOutletDirective, - ], - providers: [ - { - provide: RoutingService, - useClass: MockRoutingService, - }, - { - provide: ProductService, - useClass: MockProductService, - }, - ], - }) - .overrideComponent(ProductListItemComponent, { - set: { changeDetection: ChangeDetectionStrategy.Default }, - }) - .compileComponents(); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [RouterTestingModule, I18nTestingModule, OutletModule], + declarations: [ + ProductListItemComponent, + MockPictureComponent, + MockAddToCartComponent, + MockStarRatingComponent, + MockUrlPipe, + MockCxIconComponent, + MockFeatureDirective, + MockOutletDirective, + ], + providers: [ + { + provide: RoutingService, + useClass: MockRoutingService, + }, + { + provide: ProductService, + useClass: MockProductService, + }, + ], }) - ); + .overrideComponent(ProductListItemComponent, { + set: { changeDetection: ChangeDetectionStrategy.Default }, + }) + .compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductListItemComponent); diff --git a/projects/storefrontlib/cms-components/product/product-list/product-view/product-view.component.html b/projects/storefrontlib/cms-components/product/product-list/product-view/product-view.component.html index df5f131b597..4b9f3ebe867 100644 --- a/projects/storefrontlib/cms-components/product/product-list/product-view/product-view.component.html +++ b/projects/storefrontlib/cms-components/product/product-list/product-view/product-view.component.html @@ -7,8 +7,8 @@ viewMode === iconTypes.GRID ? ('productView.gridView' | cxTranslate) : viewMode === iconTypes.LIST - ? ('productView.listView' | cxTranslate) - : null + ? ('productView.listView' | cxTranslate) + : null }}" > { let component: ProductViewComponent; let fixture: ComponentFixture; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [NgSelectModule, FormsModule, I18nTestingModule], - declarations: [ProductViewComponent, MockCxIconComponent], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [NgSelectModule, FormsModule, I18nTestingModule], + declarations: [ProductViewComponent, MockCxIconComponent], + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductViewComponent); diff --git a/projects/storefrontlib/cms-components/product/product-summary/product-summary.component.spec.ts b/projects/storefrontlib/cms-components/product/product-summary/product-summary.component.spec.ts index 6eac8fce276..8d8f24efc3f 100644 --- a/projects/storefrontlib/cms-components/product/product-summary/product-summary.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-summary/product-summary.component.spec.ts @@ -23,20 +23,18 @@ describe('ProductSummaryComponent in product', () => { let currentProductService: CurrentProductService; let featureConfigService: FeatureConfigService; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [ItemCounterModule, I18nTestingModule, RouterTestingModule], - declarations: [ProductSummaryComponent, OutletDirective], - providers: [ - { - provide: CurrentProductService, - useClass: MockCurrentProductService, - }, - ], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ItemCounterModule, I18nTestingModule, RouterTestingModule], + declarations: [ProductSummaryComponent, OutletDirective], + providers: [ + { + provide: CurrentProductService, + useClass: MockCurrentProductService, + }, + ], + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductSummaryComponent); diff --git a/projects/storefrontlib/cms-components/product/product-tabs/product-attributes/product-attributes.component.spec.ts b/projects/storefrontlib/cms-components/product/product-tabs/product-attributes/product-attributes.component.spec.ts index a178ff96350..8dd5665c339 100644 --- a/projects/storefrontlib/cms-components/product/product-tabs/product-attributes/product-attributes.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-tabs/product-attributes/product-attributes.component.spec.ts @@ -57,20 +57,18 @@ describe('ProductAttributesComponent in product', () => { let productAttributesComponent: ProductAttributesComponent; let fixture: ComponentFixture; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [I18nTestingModule], - declarations: [ProductAttributesComponent], - providers: [ - { - provide: CurrentProductService, - useClass: MockCurrentProductService, - }, - ], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [I18nTestingModule], + declarations: [ProductAttributesComponent], + providers: [ + { + provide: CurrentProductService, + useClass: MockCurrentProductService, + }, + ], + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductAttributesComponent); diff --git a/projects/storefrontlib/cms-components/product/product-tabs/product-details-tab/product-details-tab.component.spec.ts b/projects/storefrontlib/cms-components/product/product-tabs/product-details-tab/product-details-tab.component.spec.ts index f4160a51dd7..33753bc5cc7 100644 --- a/projects/storefrontlib/cms-components/product/product-tabs/product-details-tab/product-details-tab.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-tabs/product-details-tab/product-details-tab.component.spec.ts @@ -66,27 +66,25 @@ describe('ProductDetailsTabComponent', () => { let productDetailsTabComponent: ProductDetailsTabComponent; let fixture: ComponentFixture; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [ProductDetailsTabComponent], - providers: [ - { - provide: CurrentProductService, - useClass: MockCurrentProductService, - }, - { - provide: CmsComponentData, - useClass: MockCmsComponentData, - }, - { - provide: CmsService, - useClass: MockCmsService, - }, - ], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ProductDetailsTabComponent], + providers: [ + { + provide: CurrentProductService, + useClass: MockCurrentProductService, + }, + { + provide: CmsComponentData, + useClass: MockCmsComponentData, + }, + { + provide: CmsService, + useClass: MockCmsService, + }, + ], + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductDetailsTabComponent); diff --git a/projects/storefrontlib/cms-components/product/product-tabs/product-reviews/product-reviews.component.html b/projects/storefrontlib/cms-components/product/product-tabs/product-reviews/product-reviews.component.html index aca8886dc84..ae92b426952 100644 --- a/projects/storefrontlib/cms-components/product/product-tabs/product-reviews/product-reviews.component.html +++ b/projects/storefrontlib/cms-components/product/product-tabs/product-reviews/product-reviews.component.html @@ -27,7 +27,7 @@

{{ 'productReview.overallRating' | cxTranslate }}

{{ review.headline }}
diff --git a/projects/storefrontlib/cms-components/product/product-tabs/product-reviews/product-reviews.component.spec.ts b/projects/storefrontlib/cms-components/product/product-tabs/product-reviews/product-reviews.component.spec.ts index e04d28e17a8..7f358a2ea3c 100644 --- a/projects/storefrontlib/cms-components/product/product-tabs/product-reviews/product-reviews.component.spec.ts +++ b/projects/storefrontlib/cms-components/product/product-tabs/product-reviews/product-reviews.component.spec.ts @@ -47,33 +47,31 @@ describe('ProductReviewsComponent in product', () => { let productReviewsComponent: ProductReviewsComponent; let fixture: ComponentFixture; - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [ - ReactiveFormsModule, - ItemCounterModule, - I18nTestingModule, - FormErrorsModule, - ], - providers: [ - { - provide: ProductReviewService, - useClass: MockProductReviewService, - }, - { - provide: CurrentProductService, - useClass: MockCurrentProductService, - }, - ], - declarations: [ - MockStarRatingComponent, - ProductReviewsComponent, - MockFeatureDirective, - ], - }).compileComponents(); - }) - ); + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + ReactiveFormsModule, + ItemCounterModule, + I18nTestingModule, + FormErrorsModule, + ], + providers: [ + { + provide: ProductReviewService, + useClass: MockProductReviewService, + }, + { + provide: CurrentProductService, + useClass: MockCurrentProductService, + }, + ], + declarations: [ + MockStarRatingComponent, + ProductReviewsComponent, + MockFeatureDirective, + ], + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(ProductReviewsComponent); diff --git a/projects/storefrontlib/cms-components/product/stock-notification/stock-notification-dialog/stock-notification-dialog.component.html b/projects/storefrontlib/cms-components/product/stock-notification/stock-notification-dialog/stock-notification-dialog.component.html index 111b02838bf..85d0d16a581 100644 --- a/projects/storefrontlib/cms-components/product/stock-notification/stock-notification-dialog/stock-notification-dialog.component.html +++ b/projects/storefrontlib/cms-components/product/stock-notification/stock-notification-dialog/stock-notification-dialog.component.html @@ -89,13 +89,7 @@