Skip to content

Commit

Permalink
Make external API assertions a bit less strict
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Nov 18, 2024
1 parent 4ab1038 commit c6c30d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ describe('API : External Auth Server - Authorization Endpoint', async () => {
expect(jsonResponse).to.have.property('token_type');
expect(jsonResponse.token_type).to.be.eq('Bearer');
expect(jsonResponse).to.have.property('expires_in');
expect(jsonResponse.expires_in).to.be.eq(300);
expect(jsonResponse.expires_in).to.be.a('number');
// Value should 300 but if the call took a bit longer it may be 299
// We don't need check the exact value anyway
expect(jsonResponse.expires_in).to.be.greaterThan(200);
expect(jsonResponse).to.have.property('scope');
expect(jsonResponse.scope).to.be.eq('profile email');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ describe('API : External Auth Server - Resource Endpoint', async () => {
expect(jsonResponse).to.have.property('token_type');
expect(jsonResponse.token_type).to.be.eq('Bearer');
expect(jsonResponse).to.have.property('expires_in');
expect(jsonResponse.expires_in).to.be.eq(300);
expect(jsonResponse.expires_in).to.be.a('number');
// Value should 300 but if the call took a bit longer it may be 299
// We don't need check the exact value anyway
expect(jsonResponse.expires_in).to.be.greaterThan(200);
expect(jsonResponse).to.have.property('scope');
expect(jsonResponse.scope).to.be.eq('api_client_read profile email');

Expand Down

0 comments on commit c6c30d0

Please sign in to comment.