From d7403e92adc5ff9307e4ab531ae7f54e5368e238 Mon Sep 17 00:00:00 2001 From: JHades Date: Thu, 20 Jun 2019 16:57:06 +0200 Subject: [PATCH] upgrade to NgRx 8 --- e2e/app.e2e-spec.ts | 14 -------------- src/app/app.component.spec.ts | 31 ------------------------------- src/app/auth/auth.effects.spec.ts | 25 ------------------------- src/app/auth/auth.reducer.spec.ts | 13 ------------- src/app/auth/auth.reducer.ts | 2 +- 5 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 e2e/app.e2e-spec.ts delete mode 100644 src/app/app.component.spec.ts delete mode 100644 src/app/auth/auth.effects.spec.ts delete mode 100644 src/app/auth/auth.reducer.spec.ts diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts deleted file mode 100644 index 53ad04d9..00000000 --- a/e2e/app.e2e-spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { AppPage } from './app.po'; - -describe('angular-ngrx-course App', () => { - let page: AppPage; - - beforeEach(() => { - page = new AppPage(); - }); - - it('should display welcome message', () => { - page.navigateTo(); - expect(page.getParagraphText()).toEqual('Welcome to app!'); - }); -}); diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts deleted file mode 100644 index e4ca1953..00000000 --- a/src/app/app.component.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TestBed, async } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AppComponent } from './app.component'; -describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [ - RouterTestingModule - ], - declarations: [ - AppComponent - ], - }).compileComponents(); - })); - it('should create the app', async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - })); - it(`should have as title 'app'`, async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('app'); - })); - it('should render title in a h1 tag', async(() => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); - })); -}); diff --git a/src/app/auth/auth.effects.spec.ts b/src/app/auth/auth.effects.spec.ts deleted file mode 100644 index 690642c0..00000000 --- a/src/app/auth/auth.effects.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; -import { provideMockActions } from '@ngrx/effects/testing'; -import { Observable } from 'rxjs'; - -import { AuthEffects } from './auth.effects'; - -describe('AuthService', () => { - let actions$: Observable; - let effects: AuthEffects; - - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [ - AuthEffects, - provideMockActions(() => actions$) - ] - }); - - effects = TestBed.get(AuthEffects); - }); - - it('should be created', () => { - expect(effects).toBeTruthy(); - }); -}); diff --git a/src/app/auth/auth.reducer.spec.ts b/src/app/auth/auth.reducer.spec.ts deleted file mode 100644 index 3b6d4367..00000000 --- a/src/app/auth/auth.reducer.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { authReducer, initialAuthState } from './auth.reducer'; - -describe('Auth Reducer', () => { - describe('unknown action', () => { - it('should return the initial state', () => { - const action = {} as any; - - const result = authReducer(initialAuthState, action); - - expect(result).toBe(initialAuthState); - }); - }); -}); diff --git a/src/app/auth/auth.reducer.ts b/src/app/auth/auth.reducer.ts index 9b41cf56..b31f2f5e 100644 --- a/src/app/auth/auth.reducer.ts +++ b/src/app/auth/auth.reducer.ts @@ -1,4 +1,4 @@ -import {Action, createReducer, on} from '@ngrx/store'; +import { createReducer, on} from '@ngrx/store'; import {User} from '../model/user.model'; import {AuthActions} from './action-types';