Skip to content

Commit 803d0fe

Browse files
test(champions): provide a fake catch callback
1 parent 3d0e7a0 commit 803d0fe

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/client/champions/champions.component.spec.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ describe('ChampionsComponent', () => {
6969

7070
it('should navigate when \'Enter\' is hit and one champion is available',
7171
inject([ChampionsComponent], (component) => {
72-
spyOn(component.router, 'navigate');
72+
spyOn(component.router, 'navigate').and.callFake(function() {
73+
return {
74+
catch: function(callback) {
75+
return callback();
76+
}
77+
};
78+
});
7379
expect(component.router.navigate).not.toHaveBeenCalled();
7480
component.champions = {
7581
data: [{
@@ -85,7 +91,13 @@ describe('ChampionsComponent', () => {
8591

8692
it('should not navigate when \'Enter\' is hit and multiple champions are available',
8793
inject([ChampionsComponent], (component) => {
88-
spyOn(component.router, 'navigate');
94+
spyOn(component.router, 'navigate').and.callFake(function() {
95+
return {
96+
catch: function(callback) {
97+
return callback();
98+
}
99+
};
100+
});
89101
expect(component.router.navigate).not.toHaveBeenCalled();
90102
component.champions = {
91103
data: [

0 commit comments

Comments
 (0)