Browse Source

Tests fixed

pull/164/head
Sebastian Stehle 8 years ago
parent
commit
20e0b5d081
  1. 13
      src/Squidex/app/shared/guards/unset-app.guard.spec.ts

13
src/Squidex/app/shared/guards/unset-app.guard.spec.ts

@ -6,6 +6,7 @@
*/
import { IMock, Mock, Times } from 'typemoq';
import { Observable } from 'rxjs';
import { AppsStoreService } from 'shared';
@ -19,9 +20,19 @@ describe('UnsetAppGuard', () => {
});
it('should unselect app', () => {
appStoreService.setup(x => x.selectApp(null))
.returns(() => Observable.of(false));
const guard = new UnsetAppGuard(appStoreService.object);
expect(guard.canActivate(<any>{}, <any>{})).toBeTruthy();
let result: boolean = undefined;
guard.canActivate(null, null)
.subscribe(value => {
result = value;
});
expect(result).toBeTruthy();
appStoreService.verify(x => x.selectApp(null), Times.once());
});

Loading…
Cancel
Save