1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

test: updated RequestClient specs

This commit is contained in:
Saad Jutt
2022-03-02 20:42:14 +05:00
parent 2e843e3f36
commit 495e4b9069

View File

@@ -30,6 +30,11 @@ const ERROR_MESSAGES = {
CCA: 'unable to verify the first certificate'
}
const incorrectAuthCodeErr = {
error: 'unauthorized',
error_description: 'Bad credentials'
}
describe('RequestClient', () => {
let server: http.Server
@@ -65,7 +70,7 @@ describe('RequestClient', () => {
adapter.getAccessToken('clientId', 'clientSecret', 'incorrect')
).rejects.toEqual(
prefixMessage(
new LoginRequiredError(),
new LoginRequiredError(incorrectAuthCodeErr),
'Error while getting access token. '
)
)
@@ -246,7 +251,7 @@ describe('RequestClient - Self Signed Server', () => {
adapter.getAccessToken('clientId', 'clientSecret', 'incorrect')
).rejects.toEqual(
prefixMessage(
new LoginRequiredError(),
new LoginRequiredError(incorrectAuthCodeErr),
'Error while getting access token. '
)
)