Skip to content

Commit 5e0e7c2

Browse files
committed
fix code coverage
1 parent ecbedc5 commit 5e0e7c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/Adapters/Auth/line.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ describe('LineAdapter', function () {
6363
adapter.validateOptions(validOptions);
6464
});
6565

66+
it('should throw an error if LINE auth is not configured', async function () {
67+
adapter = new LineAdapter.constructor();
68+
69+
await expectAsync(
70+
adapter.verifyIdToken({ id_token: 'the_token' })
71+
).toBeRejectedWithError('Line auth is not configured.');
72+
});
73+
6674
it('should throw an error if id_token is missing', async function () {
6775
await expectAsync(adapter.verifyIdToken({})).toBeRejectedWithError(
6876
'id token is invalid for this user.'
@@ -160,6 +168,14 @@ describe('LineAdapter', function () {
160168
'Line clientSecret is required to verify HS256 id_token.'
161169
);
162170
});
171+
172+
it('should reject an unsupported signing algorithm', async function () {
173+
spyOn(authUtils, 'getHeaderFromToken').and.returnValue({ alg: 'RS256' });
174+
175+
await expectAsync(adapter.verifyIdToken({ id_token: 'the_token' })).toBeRejectedWithError(
176+
'Unsupported Line id_token signing algorithm: RS256'
177+
);
178+
});
163179
});
164180

165181
describe('getAccessTokenFromCode', function () {

0 commit comments

Comments
 (0)