Fix process cloud page (#4075)

* Fix process cloud page

* Use FilterParamModel

* Rollback method

* Fix core unit test related to identity service

* Fix process filters cloud
Get user info from different keys

* Select the my-task filter in case the task has been created

* Add family_name and given_name to the jwt token
This commit is contained in:
Maurizio Vitale
2018-12-12 15:43:57 +00:00
committed by Eugenio Romano
parent 511087f6b1
commit e241779f3a
29 changed files with 261 additions and 240 deletions

View File

@@ -64,17 +64,14 @@ describe('IdentityUserService', () => {
});
});
it('should fetch identity user info from Jwt token', (done) => {
it('should fetch identity user info from Jwt token', () => {
localStorage.setItem('access_token', mockToken);
service.getCurrentUserInfo().subscribe(
(user) => {
expect(user).toBeDefined();
expect(user.firstName).toEqual('John');
expect(user.lastName).toEqual('Doe');
expect(user.email).toEqual('johnDoe@gmail.com');
expect(user.username).toEqual('johnDoe1');
done();
});
const user = service.getCurrentUserInfo();
expect(user).toBeDefined();
expect(user.firstName).toEqual('John');
expect(user.lastName).toEqual('Doe');
expect(user.email).toEqual('johnDoe@gmail.com');
expect(user.username).toEqual('johnDoe1');
});
it('should fetch users ', (done) => {
@@ -189,7 +186,7 @@ describe('IdentityUserService', () => {
it('should fetch users by roles without current user', (done) => {
spyOn(service, 'getUsers').and.returnValue(of(mockUsers));
spyOn(service, 'getUserRoles').and.returnValue(of(mockRoles));
spyOn(service, 'getCurrentUserInfo').and.returnValue(of(mockUsers[0]));
spyOn(service, 'getCurrentUserInfo').and.returnValue(mockUsers[0]);
service.getUsersByRolesWithoutCurrentUser([mockRoles[0].name]).then(
(res: IdentityUserModel[]) => {
@@ -202,23 +199,4 @@ describe('IdentityUserService', () => {
}
);
});
it('Should not fetch users by roles without current user if error occurred', (done) => {
const errorResponse = new HttpErrorResponse({
error: 'Mock Error',
status: 404, statusText: 'Not Found'
});
spyOn(service, 'getCurrentUserInfo').and.returnValue(throwError(errorResponse));
service.getUsersByRolesWithoutCurrentUser([mockRoles[0].name])
.catch(
(error) => {
expect(error.status).toEqual(404);
expect(error.statusText).toEqual('Not Found');
expect(error.error).toEqual('Mock Error');
done();
}
);
});
});