mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-17 17:10:05 +00:00
test: updated RequestClient specs
This commit is contained in:
@@ -30,6 +30,11 @@ const ERROR_MESSAGES = {
|
|||||||
CCA: 'unable to verify the first certificate'
|
CCA: 'unable to verify the first certificate'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const incorrectAuthCodeErr = {
|
||||||
|
error: 'unauthorized',
|
||||||
|
error_description: 'Bad credentials'
|
||||||
|
}
|
||||||
|
|
||||||
describe('RequestClient', () => {
|
describe('RequestClient', () => {
|
||||||
let server: http.Server
|
let server: http.Server
|
||||||
|
|
||||||
@@ -65,7 +70,7 @@ describe('RequestClient', () => {
|
|||||||
adapter.getAccessToken('clientId', 'clientSecret', 'incorrect')
|
adapter.getAccessToken('clientId', 'clientSecret', 'incorrect')
|
||||||
).rejects.toEqual(
|
).rejects.toEqual(
|
||||||
prefixMessage(
|
prefixMessage(
|
||||||
new LoginRequiredError(),
|
new LoginRequiredError(incorrectAuthCodeErr),
|
||||||
'Error while getting access token. '
|
'Error while getting access token. '
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -246,7 +251,7 @@ describe('RequestClient - Self Signed Server', () => {
|
|||||||
adapter.getAccessToken('clientId', 'clientSecret', 'incorrect')
|
adapter.getAccessToken('clientId', 'clientSecret', 'incorrect')
|
||||||
).rejects.toEqual(
|
).rejects.toEqual(
|
||||||
prefixMessage(
|
prefixMessage(
|
||||||
new LoginRequiredError(),
|
new LoginRequiredError(incorrectAuthCodeErr),
|
||||||
'Error while getting access token. '
|
'Error while getting access token. '
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user