Skip to content

Commit 17ea07e

Browse files
IsmaestroIsmael Ramos
authored andcommitted
fix(hero detail): solve problem with activated route mock
1 parent af02a9f commit 17ea07e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app/heroes/hero-detail/hero-detail.component.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {TestsModule} from '../../shared/modules/tests.module';
66
import {APP_CONFIG, AppConfig} from '../../config/app.config';
77
import {TranslateModule} from '@ngx-translate/core';
88
import {HeroService} from '../shared/hero.service';
9+
import {ActivatedRoute, convertToParamMap} from '@angular/router';
910

1011
describe('HeroDetailComponent', () => {
1112
let fixture;
@@ -22,6 +23,16 @@ describe('HeroDetailComponent', () => {
2223
providers: [
2324
{provide: APP_CONFIG, useValue: AppConfig},
2425
{provide: APP_BASE_HREF, useValue: '/'},
26+
{
27+
provide: ActivatedRoute,
28+
useValue: {
29+
snapshot: {
30+
paramMap: convertToParamMap({
31+
id: '1'
32+
})
33+
}
34+
}
35+
},
2536
HeroService
2637
],
2738
}).compileComponents();

0 commit comments

Comments
 (0)