-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Labels
Description
How to reproduce:
- run
npm run test - all tests succeed as expected
- modify expects for test on line 62 in auth.service.spec.ts (same issue applies for 73 and 88)
it('should login via hash if token is valid', waitForAsync (() => {
spyOn(mockService, 'tryLogin');
spyOn(mockService, 'silentRefresh');
mockService.updateTokenValidity(true);
service.runInitialLoginSequence().then(() => {
expect(mockService.tryLogin).toHaveBeenCalled();
expect(mockService.silentRefresh).not.toHaveBeenCalled();
});
to
it('should login via hash if token is valid', waitForAsync (() => {
spyOn(mockService, 'tryLogin');
spyOn(mockService, 'silentRefresh');
mockService.updateTokenValidity(true);
service.runInitialLoginSequence().then(() => {
expect(mockService.tryLogin).not.toHaveBeenCalled();
expect(mockService.silentRefresh).toHaveBeenCalled();
});
- run
npm run testagain - test still succeeds which shouldn't happen