mirror of https://github.com/Squidex/squidex.git
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.
32 lines
858 B
32 lines
858 B
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { AppsState } from '@app/shared/internal';
|
|
import { firstValueFrom, 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', async () => {
|
|
appsState.setup(x => x.select(null))
|
|
.returns(() => of(null));
|
|
|
|
const result = await firstValueFrom(appGuard.canActivate());
|
|
|
|
expect(result).toBeTruthy();
|
|
|
|
appsState.verify(x => x.select(null), Times.once());
|
|
});
|
|
});
|
|
|