From 913fc7c2a5f358fcfce0f1efbf9722f3cf964a6a Mon Sep 17 00:00:00 2001 From: timdeschryver <28659384+timdeschryver@users.noreply.github.com> Date: Wed, 10 Feb 2021 18:36:08 +0100 Subject: [PATCH] chore: upgrade to v11 --- angular.json | 1 - package.json | 52 ++++++++-------- .../src/app/app-routing.module.ts | 3 +- .../src/app/app/app.component.spec.ts | 55 +++++++++-------- .../about/about/about.component.spec.ts | 20 ++++--- .../authenticated.component.spec.ts | 20 ++++--- .../crud/components/crud.component.spec.ts | 40 +++++++------ .../elements/elements.component.spec.ts | 28 +++++---- .../examples/examples.component.spec.ts | 44 +++++++------- .../notifications.component.spec.ts | 22 ++++--- .../components/user.component.spec.ts | 22 ++++--- .../stock-market-container.component.spec.ts | 60 ++++++++++--------- .../theming/child/child.component.spec.ts | 20 ++++--- .../theming/parent/parent.component.spec.ts | 20 ++++--- .../feature-list.component.spec.ts | 20 ++++--- .../settings-container.component.spec.ts | 50 ++++++++-------- 16 files changed, 267 insertions(+), 210 deletions(-) diff --git a/angular.json b/angular.json index 55d60b09d..c9f1d76f7 100755 --- a/angular.json +++ b/angular.json @@ -45,7 +45,6 @@ "optimization": true, "outputHashing": "all", "sourceMap": false, - "extractCss": true, "namedChunks": false, "extractLicenses": true, "vendorChunk": false, diff --git a/package.json b/package.json index a3a741e49..facb5d96e 100755 --- a/package.json +++ b/package.json @@ -38,44 +38,44 @@ "dependencies": { "@angular-extensions/elements": "~10.1.1", "@angular-extensions/model": "^10.0.1", - "@angular/animations": "~10.2.3", - "@angular/cdk": "~10.2.7", - "@angular/common": "~10.2.3", - "@angular/compiler": "~10.2.3", - "@angular/core": "~10.2.3", - "@angular/forms": "~10.2.3", - "@angular/material": "~10.2.7", - "@angular/platform-browser": "~10.2.3", - "@angular/platform-browser-dynamic": "~10.2.3", - "@angular/router": "~10.2.3", + "@angular/animations": "~11.1.2", + "@angular/cdk": "~11.2.0", + "@angular/common": "~11.1.2", + "@angular/compiler": "~11.1.2", + "@angular/core": "~11.1.2", + "@angular/forms": "~11.1.2", + "@angular/material": "~11.2.0", + "@angular/platform-browser": "~11.1.2", + "@angular/platform-browser-dynamic": "~11.1.2", + "@angular/router": "~11.1.2", "@fortawesome/angular-fontawesome": "^0.7.0", "@fortawesome/fontawesome-free": "^5.15.1", "@fortawesome/fontawesome-svg-core": "^1.2.32", "@fortawesome/free-brands-svg-icons": "^5.15.1", "@fortawesome/free-solid-svg-icons": "^5.15.1", - "@ngrx/effects": "~10.0.1", - "@ngrx/entity": "~10.0.1", - "@ngrx/router-store": "~10.0.1", - "@ngrx/store": "~10.0.1", - "@ngrx/store-devtools": "~10.0.1", + "@ngrx/effects": "~11.0.0", + "@ngrx/entity": "~11.0.0", + "@ngrx/router-store": "~11.0.0", + "@ngrx/store": "~11.0.0", + "@ngrx/store-devtools": "~11.0.0", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "^6.0.0", "bootstrap": "^4.5.3", "browser-detect": "^0.2.28", "rxjs": "~6.6.3", - "tslib": "^2.0.3", + "tslib": "^2.0.0", "uuid": "^8.3.1", "zone.js": "~0.11.3" }, "devDependencies": { - "@angular-devkit/build-angular": "~0.1002.0", + "@angular-devkit/build-angular": "~0.1101.4", "@angular-eslint/eslint-plugin": "^0.6.0-beta.0", - "@angular/cli": "~10.2.0", - "@angular/compiler-cli": "~10.2.3", - "@angular/language-service": "~10.2.3", + "@angular/cli": "~11.1.4", + "@angular/compiler-cli": "~11.1.2", + "@angular/language-service": "~11.1.2", "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", - "@types/jasmine": "~3.6.1", + "@types/jasmine": "~3.6.0", "@types/jasminewd2": "^2.0.8", "@types/node": "^14.14.7", "@types/uuid": "^8.3.0", @@ -83,19 +83,19 @@ "@typescript-eslint/eslint-plugin-tslint": "^4.7.0", "@typescript-eslint/parser": "^4.7.0", "all-contributors-cli": "^6.19.0", - "codelyzer": "^6.0.1", + "codelyzer": "^6.0.0", "eslint": "^7.13.0", "eslint-config-prettier": "^6.15.0", "eslint-plugin-import": "^2.22.1", "express": "^4.16.4", "husky": "^4.3.0", "jasmine-core": "~3.6.0", - "jasmine-spec-reporter": "~6.0.0", + "jasmine-spec-reporter": "~5.0.0", "karma": "~5.2.3", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.3", - "karma-jasmine": "~4.0.1", - "karma-jasmine-html-reporter": "^1.5.4", + "karma-jasmine": "~4.0.0", + "karma-jasmine-html-reporter": "^1.5.0", "karma-spec-reporter": "^0.0.32", "npm-run-all": "^4.1.5", "prettier": "^2.1.2", @@ -108,4 +108,4 @@ "typescript": "~4.0.5", "webpack-bundle-analyzer": "^4.1.0" } -} +} \ No newline at end of file diff --git a/projects/angular-ngrx-material-starter/src/app/app-routing.module.ts b/projects/angular-ngrx-material-starter/src/app/app-routing.module.ts index 43851c6e2..19f53ee9e 100755 --- a/projects/angular-ngrx-material-starter/src/app/app-routing.module.ts +++ b/projects/angular-ngrx-material-starter/src/app/app-routing.module.ts @@ -45,7 +45,8 @@ const routes: Routes = [ RouterModule.forRoot(routes, { useHash: true, scrollPositionRestoration: 'enabled', - preloadingStrategy: PreloadAllModules + preloadingStrategy: PreloadAllModules, + relativeLinkResolution: 'legacy' }) ], exports: [RouterModule] diff --git a/projects/angular-ngrx-material-starter/src/app/app/app.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/app/app.component.spec.ts index 77ee57fed..7ed84ce5c 100755 --- a/projects/angular-ngrx-material-starter/src/app/app/app.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/app/app.component.spec.ts @@ -1,5 +1,5 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { TestBed, async } from '@angular/core/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; @@ -19,30 +19,35 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { let store: MockStore; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [ - SharedModule, - MatSidenavModule, - MatToolbarModule, - RouterTestingModule, - NoopAnimationsModule, - TranslateModule.forRoot() - ], - providers: [provideMockStore()], - declarations: [AppComponent] - }).compileComponents(); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + MatSidenavModule, + MatToolbarModule, + RouterTestingModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + providers: [provideMockStore()], + declarations: [AppComponent] + }).compileComponents(); - store = TestBed.inject(MockStore); - store.overrideSelector(selectIsAuthenticated, false); - store.overrideSelector(selectSettingsStickyHeader, true); - store.overrideSelector(selectSettingsLanguage, 'en'); - store.overrideSelector(selectEffectiveTheme, 'default'); - })); + store = TestBed.inject(MockStore); + store.overrideSelector(selectIsAuthenticated, false); + store.overrideSelector(selectSettingsStickyHeader, true); + store.overrideSelector(selectSettingsLanguage, 'en'); + store.overrideSelector(selectEffectiveTheme, 'default'); + }) + ); - it('should create the app', async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - })); + it( + 'should create the app', + waitForAsync(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + }) + ); }); diff --git a/projects/angular-ngrx-material-starter/src/app/features/about/about/about.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/about/about/about.component.spec.ts index 06433bd6a..dd65c48cf 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/about/about/about.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/about/about/about.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; @@ -10,12 +10,18 @@ describe('AboutComponent', () => { let component: AboutComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [SharedModule, NoopAnimationsModule, TranslateModule.forRoot()], - declarations: [AboutComponent] - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + declarations: [AboutComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(AboutComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/authenticated/authenticated.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/authenticated/authenticated.component.spec.ts index ff3c5afdd..a5e3b978f 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/authenticated/authenticated.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/authenticated/authenticated.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; @@ -10,12 +10,18 @@ describe('AuthenticatedComponent', () => { let component: AuthenticatedComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [SharedModule, NoopAnimationsModule, TranslateModule.forRoot()], - declarations: [AuthenticatedComponent] - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + declarations: [AuthenticatedComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(AuthenticatedComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/crud/components/crud.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/crud/components/crud.component.spec.ts index b0651fd16..3c0024cc8 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/crud/components/crud.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/crud/components/crud.component.spec.ts @@ -1,6 +1,6 @@ import { RouterTestingModule } from '@angular/router/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { provideMockStore, MockStore } from '@ngrx/store/testing'; @@ -14,24 +14,26 @@ describe('CrudComponent', () => { let fixture: ComponentFixture; let store: MockStore; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [ - SharedModule, - NoopAnimationsModule, - RouterTestingModule, - TranslateModule.forRoot() - ], - providers: [provideMockStore()], - declarations: [CrudComponent] - }).compileComponents(); - store = TestBed.inject(MockStore); - store.overrideSelector(selectAllBooks, []); - store.overrideSelector(selectSelectedBook, null); - fixture = TestBed.createComponent(CrudComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + RouterTestingModule, + TranslateModule.forRoot() + ], + providers: [provideMockStore()], + declarations: [CrudComponent] + }).compileComponents(); + store = TestBed.inject(MockStore); + store.overrideSelector(selectAllBooks, []); + store.overrideSelector(selectSelectedBook, null); + fixture = TestBed.createComponent(CrudComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }) + ); it('should create', () => { expect(component).toBeTruthy(); }); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/elements/elements.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/elements/elements.component.spec.ts index 240a86bbe..961361aae 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/elements/elements.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/elements/elements.component.spec.ts @@ -1,5 +1,5 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { LazyElementsModule } from '@angular-extensions/elements'; import { TranslateModule } from '@ngx-translate/core'; @@ -12,18 +12,20 @@ describe('ElementsComponent', () => { let component: ElementsComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [ - SharedModule, - NoopAnimationsModule, - TranslateModule.forRoot(), - LazyElementsModule - ], - declarations: [ElementsComponent] - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + schemas: [CUSTOM_ELEMENTS_SCHEMA], + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot(), + LazyElementsModule + ], + declarations: [ElementsComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(ElementsComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/examples/examples.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/examples/examples.component.spec.ts index 03a5fb6b7..e5c9f0d1d 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/examples/examples.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/examples/examples.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; @@ -13,27 +13,29 @@ describe('ExamplesComponent', () => { let component: ExamplesComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [ - HttpClientTestingModule, - SharedModule, - NoopAnimationsModule, - RouterTestingModule, - TranslateModule.forRoot() - ], - providers: [ - provideMockStore({ - initialState: { - auth: { - isAuthenticated: false + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + HttpClientTestingModule, + SharedModule, + NoopAnimationsModule, + RouterTestingModule, + TranslateModule.forRoot() + ], + providers: [ + provideMockStore({ + initialState: { + auth: { + isAuthenticated: false + } } - } - }) - ], - declarations: [ExamplesComponent] - }).compileComponents(); - })); + }) + ], + declarations: [ExamplesComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(ExamplesComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/notifications/components/notifications.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/notifications/components/notifications.component.spec.ts index bb6ac19f8..0621128eb 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/notifications/components/notifications.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/notifications/components/notifications.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; @@ -11,13 +11,19 @@ describe('NotificationsComponent', () => { let component: NotificationsComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [SharedModule, NoopAnimationsModule, TranslateModule.forRoot()], - providers: [NotificationService], - declarations: [NotificationsComponent] - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + providers: [NotificationService], + declarations: [NotificationsComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(NotificationsComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/simple-state-management/components/user.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/simple-state-management/components/user.component.spec.ts index 57a7c36c9..77f048936 100644 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/simple-state-management/components/user.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/simple-state-management/components/user.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { UserComponent } from './user.component'; import { SharedModule } from '../../../../shared/shared.module'; @@ -10,13 +10,19 @@ describe('UserComponent', () => { let component: UserComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [SharedModule, NoopAnimationsModule, TranslateModule.forRoot()], - providers: [UserService], - declarations: [UserComponent] - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + providers: [UserService], + declarations: [UserComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(UserComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/stock-market/components/stock-market-container.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/stock-market/components/stock-market-container.component.spec.ts index 65152e7fb..411cde836 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/stock-market/components/stock-market-container.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/stock-market/components/stock-market-container.component.spec.ts @@ -1,6 +1,6 @@ import { By } from '@angular/platform-browser'; import { HttpErrorResponse } from '@angular/common/http'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; import { MemoizedSelector } from '@ngrx/store'; @@ -42,34 +42,36 @@ describe('StockMarketContainerComponent', () => { fixture.debugElement.query(By.css('mat-card fa-icon[icon="caret-down"]')); describe('given component booted', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [ - SharedModule, - NoopAnimationsModule, - TranslateModule.forRoot() - ], - providers: [StockMarketService, provideMockStore()], - declarations: [StockMarketContainerComponent] - }).compileComponents(); - - const stockMarketService = TestBed.inject( - StockMarketService - ); - retrieveStockSpy = spyOn( - stockMarketService, - 'retrieveStock' - ).and.returnValue(EMPTY); - - store = TestBed.inject(MockStore); - mockSelectStockMarket = store.overrideSelector(selectStockMarket, { - symbol: 'AAPL', - loading: false - }); - fixture = TestBed.createComponent(StockMarketContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + providers: [StockMarketService, provideMockStore()], + declarations: [StockMarketContainerComponent] + }).compileComponents(); + + const stockMarketService = TestBed.inject( + StockMarketService + ); + retrieveStockSpy = spyOn( + stockMarketService, + 'retrieveStock' + ).and.returnValue(EMPTY); + + store = TestBed.inject(MockStore); + mockSelectStockMarket = store.overrideSelector(selectStockMarket, { + symbol: 'AAPL', + loading: false + }); + fixture = TestBed.createComponent(StockMarketContainerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }) + ); it('should be created', () => { expect(component).toBeTruthy(); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/theming/child/child.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/theming/child/child.component.spec.ts index 064746190..f1f50b037 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/theming/child/child.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/theming/child/child.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; @@ -10,12 +10,18 @@ describe('ChildComponent', () => { let component: ChildComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [SharedModule, NoopAnimationsModule, TranslateModule.forRoot()], - declarations: [ChildComponent] - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + declarations: [ChildComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(ChildComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/examples/theming/parent/parent.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/examples/theming/parent/parent.component.spec.ts index ee3469746..396495775 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/examples/theming/parent/parent.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/examples/theming/parent/parent.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; @@ -11,12 +11,18 @@ describe('ParentComponent', () => { let component: ParentComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [SharedModule, NoopAnimationsModule, TranslateModule.forRoot()], - declarations: [ParentComponent, ChildComponent] - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + declarations: [ParentComponent, ChildComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(ParentComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/feature-list/feature-list/feature-list.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/feature-list/feature-list/feature-list.component.spec.ts index 7a6ea0b9d..df4e654b4 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/feature-list/feature-list/feature-list.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/feature-list/feature-list/feature-list.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; @@ -10,12 +10,18 @@ describe('FeatureListComponent', () => { let component: FeatureListComponent; let fixture: ComponentFixture; - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [SharedModule, NoopAnimationsModule, TranslateModule.forRoot()], - declarations: [FeatureListComponent] - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + declarations: [FeatureListComponent] + }).compileComponents(); + }) + ); beforeEach(() => { fixture = TestBed.createComponent(FeatureListComponent); diff --git a/projects/angular-ngrx-material-starter/src/app/features/settings/settings/settings-container.component.spec.ts b/projects/angular-ngrx-material-starter/src/app/features/settings/settings/settings-container.component.spec.ts index f3e88d922..c67555221 100755 --- a/projects/angular-ngrx-material-starter/src/app/features/settings/settings/settings-container.component.spec.ts +++ b/projects/angular-ngrx-material-starter/src/app/features/settings/settings/settings-container.component.spec.ts @@ -1,6 +1,6 @@ import { By } from '@angular/platform-browser'; import { MatSlideToggle } from '@angular/material/slide-toggle'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; import { provideMockStore, MockStore } from '@ngrx/store/testing'; @@ -36,29 +36,31 @@ describe('SettingsComponent', () => { const getSelectOptions = () => fixture.debugElement.queryAll(By.css('mat-option')); - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [ - FontAwesomeModule, - SharedModule, - NoopAnimationsModule, - TranslateModule.forRoot() - ], - providers: [provideMockStore()], - declarations: [SettingsContainerComponent] - }).compileComponents(); - - TestBed.inject(FaIconLibrary).addIcons(faBars); - - store = TestBed.inject(MockStore); - mockSelectSettings = store.overrideSelector( - selectSettings, - {} as SettingsState - ); - fixture = TestBed.createComponent(SettingsContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [ + FontAwesomeModule, + SharedModule, + NoopAnimationsModule, + TranslateModule.forRoot() + ], + providers: [provideMockStore()], + declarations: [SettingsContainerComponent] + }).compileComponents(); + + TestBed.inject(FaIconLibrary).addIcons(faBars); + + store = TestBed.inject(MockStore); + mockSelectSettings = store.overrideSelector( + selectSettings, + {} as SettingsState + ); + fixture = TestBed.createComponent(SettingsContainerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }) + ); it('should dispatch change sticky header on sticky header toggle', () => { dispatchSpy = spyOn(store, 'dispatch');