11import { ComponentFixture , TestBed } from '@angular/core/testing' ;
22import { SsoComponent } from './sso.component' ;
33import { HttpClientTestingModule } from '@angular/common/http/testing' ;
4- import { ActivatedRoute , convertToParamMap , provideRouter , Router } from '@angular/router' ;
4+ import { ActivatedRoute , convertToParamMap , Router , RouterLink , RouterModule } from '@angular/router' ;
55import { CompanyService } from 'src/app/services/company.service' ;
66import { of } from 'rxjs' ;
77
8- fdescribe ( 'SsoComponent' , ( ) => {
8+ describe ( 'SsoComponent' , ( ) => {
99 let component : SsoComponent ;
1010 let fixture : ComponentFixture < SsoComponent > ;
1111 let companyServiceSpy : jasmine . SpyObj < CompanyService > ;
@@ -31,7 +31,11 @@ fdescribe('SsoComponent', () => {
3131 }
3232 }
3333 } ,
34- navigate : jasmine . createSpy ( 'navigate' )
34+ navigate : jasmine . createSpy ( 'navigate' ) ,
35+ events : of ( null ) ,
36+ url : '/company' ,
37+ createUrlTree : jasmine . createSpy ( 'createUrlTree' ) . and . returnValue ( { } ) ,
38+ serializeUrl : jasmine . createSpy ( 'serializeUrl' ) . and . returnValue ( 'company' )
3539 } ;
3640
3741 beforeEach ( async ( ) => {
@@ -41,10 +45,10 @@ fdescribe('SsoComponent', () => {
4145 await TestBed . configureTestingModule ( {
4246 imports : [
4347 SsoComponent ,
44- HttpClientTestingModule
48+ HttpClientTestingModule ,
49+ RouterModule . forRoot ( [ ] )
4550 ] ,
4651 providers : [
47- provideRouter ( [ ] ) ,
4852 { provide : ActivatedRoute , useValue : mockActivatedRoute } ,
4953 { provide : Router , useValue : mockRouter } ,
5054 { provide : CompanyService , useValue : companyServiceSpy }
0 commit comments