Skip to content

Commit 11de06a

Browse files
committed
fix(tests): make compliance tests mixed using db ids as numbers and strings
1 parent c76e4c0 commit 11de06a

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

test/compliance/client-authentication_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const auth = new OAuth2Server({
3333
});
3434

3535
const user = db.saveUser({ id: 1, username: 'test', password: 'test'});
36-
const client = db.saveClient({ id: 'a', secret: 'b', grants: ['password'] });
36+
const client = db.saveClient({ id: 1, secret: 'b', grants: ['password'] });
3737
const scope = 'read write';
3838

3939
function createDefaultRequest () {

test/compliance/password-grant-type_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const auth = new OAuth2Server({
7171
});
7272

7373
const user = db.saveUser({ id: 1, username: 'test', password: 'test'});
74-
const client = db.saveClient({ id: 'a', secret: 'b', grants: ['password'] });
74+
const client = db.saveClient({ id: 1, secret: 'b', grants: ['password'] });
7575
const scope = 'read write';
7676

7777
function createDefaultRequest () {

test/compliance/refresh-token-grant-type_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const auth = new OAuth2Server({
7373
});
7474

7575
const user = db.saveUser({ id: 1, username: 'test', password: 'test'});
76-
const client = db.saveClient({ id: 'a', secret: 'b', grants: ['password', 'refresh_token'] });
76+
const client = db.saveClient({ id: 1, secret: 'b', grants: ['password', 'refresh_token'] });
7777
const scope = 'read write';
7878

7979
function createLoginRequest () {

test/helpers/db.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class DB {
3131
findClient (clientId, clientSecret) {
3232
return this.clients.find(client => {
3333
if (clientSecret) {
34-
return client.id === clientId && client.secret === clientSecret;
34+
return client.id == clientId && client.secret === clientSecret;
3535
} else {
36-
return client.id === clientId;
36+
return client.id == clientId;
3737
}
3838
});
3939
}

0 commit comments

Comments
 (0)