mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
AAE-30882 - Fixed unit test for js-api
This commit is contained in:
@@ -29,7 +29,15 @@ export class BpmAuthMock extends BaseMock {
|
||||
}
|
||||
|
||||
get200Response(): void {
|
||||
this.addCorsSupport();
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.defaultReplyHeaders({
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'GET,PUT,POST,DELETE,OPTIONS',
|
||||
'Access-Control-Allow-Headers': 'Content-Type, Authorization, Content-Length, X-Requested-With, Cache-Control, X-CSRF-TOKEN',
|
||||
'Access-Control-Allow-Credentials': 'true',
|
||||
'Set-Cookie': 'ACTIVITI_REMEMBER_ME=NjdOdGwvcUtFTkVEczQyMGh4WFp5QT09OmpUL1UwdFVBTC94QTJMTFFUVFgvdFE9PQ; Path=/; HttpOnly'
|
||||
})
|
||||
.post(
|
||||
'/activiti-app/app/authentication',
|
||||
'j_username=' + this.username + '&j_password=' + this.password + '&_spring_security_remember_me=true&submit=Login'
|
||||
@@ -38,11 +46,11 @@ export class BpmAuthMock extends BaseMock {
|
||||
}
|
||||
|
||||
get200ResponseLogout(): void {
|
||||
nock(this.host, { encodedQueryParams: true }).get('/activiti-app/app/logout', {}).reply(200);
|
||||
this.createNockWithCors().get('/activiti-app/app/logout').reply(200);
|
||||
}
|
||||
|
||||
get401Response(): void {
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
this.createNockWithCors()
|
||||
.post('/activiti-app/app/authentication', 'j_username=wrong&j_password=name&_spring_security_remember_me=true&submit=Login')
|
||||
.reply(401, {
|
||||
error: {
|
||||
@@ -53,7 +61,7 @@ export class BpmAuthMock extends BaseMock {
|
||||
}
|
||||
|
||||
get403Response(): void {
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
this.createNockWithCors()
|
||||
.post('/activiti-app/app/authentication', 'j_username=wrong&j_password=name&_spring_security_remember_me=true&submit=Login')
|
||||
.reply(403, {
|
||||
error: {
|
||||
|
Reference in New Issue
Block a user