Skip to content

Commit

Permalink
test: cover uncovered method
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoBorzi committed Aug 6, 2019
1 parent 50697a5 commit 57f1ddd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/services/editors/creature/spawns-addon.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ describe('SpawnsAddonService', () => {
],
}));

it('should be created', () => {
it('selectQuery should correctly work', () => {
const service: SpawnsAddonService = TestBed.get(SpawnsAddonService);
expect(service).toBeTruthy();
const querySpy = spyOn(TestBed.get(QueryService),'query');
const id = 123;

service.selectQuery(id);

expect(querySpy).toHaveBeenCalledWith(
`SELECT a.* FROM creature AS c INNER JOIN creature_addon AS a ON c.guid = a.guid WHERE c.id = ${id}`
);
});
});

0 comments on commit 57f1ddd

Please sign in to comment.