Skip to content

Commit

Permalink
fix(hero service): solve problem with created test heroes become useless
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismaestro authored and Ismael Ramos committed Apr 20, 2018
1 parent 17ea07e commit ca11544
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/heroes/shared/hero.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ describe('HeroService', () => {
'alterEgo': 'test'
}).subscribe((hero) => {
expect(hero.id).not.toBeNull();
heroService.deleteHeroById(hero.id).subscribe((response) => {
expect(response).toEqual({});
});
});
}));

Expand All @@ -90,6 +93,9 @@ describe('HeroService', () => {
heroService.like(hero).subscribe(() => {
}, (error) => {
expect(error).toBe('maximum votes');
heroService.deleteHeroById(hero.id).subscribe((response) => {
expect(response).toEqual({});
});
});
});
}));
Expand All @@ -103,6 +109,9 @@ describe('HeroService', () => {
}).subscribe((hero) => {
heroService.like(hero).subscribe((response) => {
expect(response).toEqual({});
heroService.deleteHeroById(hero.id).subscribe((response) => {
expect(response).toEqual({});
});
});
});
}));
Expand Down

0 comments on commit ca11544

Please sign in to comment.