Skip to content

Commit 79b631a

Browse files
committed
CCM-11889: coverage
1 parent d625012 commit 79b631a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lambdas/authorizer/src/__tests__/index.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,21 @@ test('returns Deny policy when authorization fails', async () => {
149149

150150
expect(res).toEqual(denyPolicy);
151151
});
152+
153+
test('returns Deny policy when headers missing', async () => {
154+
lambdaCognitoAuthorizer.authorize.mockResolvedValue({
155+
success: false,
156+
});
157+
158+
const res = await handler(
159+
mock<APIGatewayRequestAuthorizerEvent>({
160+
requestContext,
161+
headers: undefined,
162+
type: 'REQUEST',
163+
}),
164+
mock<Context>(),
165+
jest.fn()
166+
);
167+
168+
expect(res).toEqual(denyPolicy);
169+
});

0 commit comments

Comments
 (0)