mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
15 lines
545 B
TypeScript
15 lines
545 B
TypeScript
import { DenyAllAuthorizer } from '../../../src/authorization/DenyAllAuthorizer';
|
|
import { ForbiddenHttpError } from '../../../src/util/errors/ForbiddenHttpError';
|
|
|
|
describe('A DenyAllAuthorizer', (): void => {
|
|
const authorizer = new DenyAllAuthorizer();
|
|
|
|
it('can handle all requests.', async(): Promise<void> => {
|
|
await expect(authorizer.canHandle({} as any)).resolves.toBeUndefined();
|
|
});
|
|
|
|
it('rejects all requests.', async(): Promise<void> => {
|
|
await expect(authorizer.handle()).rejects.toThrow(ForbiddenHttpError);
|
|
});
|
|
});
|