import { async, ComponentFixture, TestBed } from '@angular/core/testing'
import { TranslateModule } from '@ngx-translate/core'
import { MatCardModule } from '@angular/material/card'
import { MatCheckboxModule } from '@angular/material/checkbox'
import { MatFormFieldModule } from '@angular/material/form-field'
import { CookieModule } from 'ngx-cookie'
import { HttpClientModule } from '@angular/common/http'
import { RouterTestingModule } from '@angular/router/testing'

import { OAuthComponent } from './oauth.component'
import { LoginComponent } from '../login/login.component'

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

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ OAuthComponent, LoginComponent ],
      imports: [
        RouterTestingModule.withRoutes([
          { path: 'login', component: LoginComponent }
        ]
        ),
        CookieModule.forRoot(),
        TranslateModule.forRoot(),
        MatCardModule,
        MatFormFieldModule,
        MatCheckboxModule,
        HttpClientModule
      ]
    })
    .compileComponents()
  }))

  beforeEach(() => {
    fixture = TestBed.createComponent(OAuthComponent)
    component = fixture.componentInstance
    fixture.detectChanges()
  })

  it('should create', () => {
    expect(component).toBeTruthy()
  })
})

import { async, ComponentFixture, TestBed } from '@angular/core/testing'
import { TranslateModule } from '@ngx-translate/core'

import { OAuthComponent } from './oauth.component'

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

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ OAuthComponent ],
      imports: [
        TranslateModule.forRoot()
      ]
    })
    .compileComponents()
  }))

  beforeEach(() => {
    fixture = TestBed.createComponent(OAuthComponent)
    component = fixture.componentInstance
    fixture.detectChanges()
  })

  xit('should create', () => {
    expect(component).toBeTruthy()
  })
})

--- 
+++ 
@@ -1,7 +1,14 @@
 import { async, ComponentFixture, TestBed } from '@angular/core/testing'
 import { TranslateModule } from '@ngx-translate/core'
+import { MatCardModule } from '@angular/material/card'
+import { MatCheckboxModule } from '@angular/material/checkbox'
+import { MatFormFieldModule } from '@angular/material/form-field'
+import { CookieModule } from 'ngx-cookie'
+import { HttpClientModule } from '@angular/common/http'
+import { RouterTestingModule } from '@angular/router/testing'
 
 import { OAuthComponent } from './oauth.component'
+import { LoginComponent } from '../login/login.component'
 
 describe('OAuthComponent', () => {
   let component: OAuthComponent
@@ -9,9 +16,18 @@
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ OAuthComponent ],
+      declarations: [ OAuthComponent, LoginComponent ],
       imports: [
-        TranslateModule.forRoot()
+        RouterTestingModule.withRoutes([
+          { path: 'login', component: LoginComponent }
+        ]
+        ),
+        CookieModule.forRoot(),
+        TranslateModule.forRoot(),
+        MatCardModule,
+        MatFormFieldModule,
+        MatCheckboxModule,
+        HttpClientModule
       ]
     })
     .compileComponents()
@@ -23,7 +39,7 @@
     fixture.detectChanges()
   })
 
-  xit('should create', () => {
+  it('should create', () => {
     expect(component).toBeTruthy()
   })
 })
Enable oauth component unit test
