[AAE-1152] Making sure the people and group widget is working fine as part of form (#5322)

* Making sure the people and group widget is working fine as part of the form

* Be able to save a form with people and group

* Fix tslint

* Fix html error

* Fix unit test
This commit is contained in:
Maurizio Vitale
2019-12-11 11:22:50 +00:00
committed by Eugenio Romano
parent d8b703b6ef
commit 88d89b4ca8
10 changed files with 98 additions and 55 deletions

View File

@@ -34,8 +34,6 @@ import {
groupsMockApi,
roleMappingApi,
clientRoles,
returnCallQueryParameters,
returnCallUrl,
applicationDetailsMockApi,
mockApiError,
mockIdentityGroup1,
@@ -233,22 +231,14 @@ describe('IdentityGroupService', () => {
);
});
it('should append to the call all the parameters', (done) => {
spyOn(apiService, 'getInstance').and.returnValue(returnCallQueryParameters);
service.findGroupsByName(<IdentityGroupSearchParam> {name: 'mock'}).subscribe((res) => {
expect(res).toBeDefined();
expect(res).not.toBeNull();
expect(res.search).toBe('mock');
done();
});
});
it('should request groups api url', (done) => {
spyOn(apiService, 'getInstance').and.returnValue(returnCallUrl);
service.findGroupsByName(<IdentityGroupSearchParam> {name: 'mock'}).subscribe((requestUrl) => {
expect(requestUrl).toBeDefined();
expect(requestUrl).not.toBeNull();
expect(requestUrl).toContain('/groups');
it('should return only the properties of IdentityGroupSearchParam', (done) => {
spyOn(apiService, 'getInstance').and.returnValue(groupsMockApi);
service.findGroupsByName(<IdentityGroupSearchParam> {name: 'mock'}).subscribe((groups) => {
expect(groups).toBeDefined();
expect(groups).toBeDefined();
expect(groups[0].id).toEqual('mock-group-id-1');
expect(groups[0].name).toEqual('Mock Group 1');
expect(groups[0]['subGroups']).not.toBeDefined();
done();
});
});