Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
887 B

/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
import { AppsState } from '@app/shared/internal';
import { of } from 'rxjs';
import { IMock, Mock, Times } from 'typemoq';
import { UnsetAppGuard } from './unset-app.guard';
describe('UnsetAppGuard', () => {
let appsState: IMock<AppsState>;
let appGuard: UnsetAppGuard;
beforeEach(() => {
appsState = Mock.ofType<AppsState>();
appGuard = new UnsetAppGuard(appsState.object);
});
it('should unselect app', () => {
appsState.setup(x => x.select(null))
.returns(() => of(null));
let result = false;
appGuard.canActivate().subscribe(value => {
result = value;
});
expect(result).toBeTruthy();
appsState.verify(x => x.select(null), Times.once());
});
});