mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[ADF-1162] Form List - Fix the getForms service response (#2125)
* Fix the getForms service response * Fix unit test
This commit is contained in:
parent
92e30c2fa3
commit
df32a49c9e
@ -355,14 +355,19 @@ describe('Form service', () => {
|
||||
it('should get all the forms with modelType=2', (done) => {
|
||||
service.getForms().subscribe(result => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('models?modelType=2')).toBeTruthy();
|
||||
expect(result).toEqual({});
|
||||
expect(result.length).toEqual(2);
|
||||
done();
|
||||
});
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
'status': 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify({})
|
||||
responseText: JSON.stringify({
|
||||
data: [
|
||||
{ name: 'FakeName-1', lastUpdatedByFullName: 'FakeUser-1', lastUpdated: '2017-01-02' },
|
||||
{ name: 'FakeName-2', lastUpdatedByFullName: 'FakeUser-2', lastUpdated: '2017-01-03' }
|
||||
]
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -150,9 +150,9 @@ export class FormService {
|
||||
'modelType': 2
|
||||
};
|
||||
|
||||
return Observable.fromPromise(
|
||||
this.apiService.getInstance().activiti.modelsApi.getModels(opts)
|
||||
);
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.modelsApi.getModels(opts))
|
||||
.map(this.toJsonArray)
|
||||
.catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user