mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#992 Use the js API and fix unit test
This commit is contained in:
@@ -82,8 +82,26 @@ describe('Test ng2-activiti-analytics Report list', () => {
|
||||
});
|
||||
|
||||
it('should return the default reports when the report list is empty', (done) => {
|
||||
jasmine.Ajax.stubRequest('http://localhost:9999/activiti-app/app/rest/reporting/reports').andReturn({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: []
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
jasmine.Ajax.stubRequest('http://localhost:9999/activiti-app/app/rest/reporting/default-reports').andReturn({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: []
|
||||
});
|
||||
|
||||
jasmine.Ajax.stubRequest('http://localhost:9999/activiti-app/app/rest/reporting/reports').andReturn({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: reportList
|
||||
});
|
||||
|
||||
component.onSuccess.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('#report-list-0 > i').innerHTML).toBe('assignment');
|
||||
@@ -96,23 +114,6 @@ describe('Test ng2-activiti-analytics Report list', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: []
|
||||
});
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: []
|
||||
});
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: reportList
|
||||
});
|
||||
});
|
||||
|
||||
it('Report render the report list relative to a single app', (done) => {
|
||||
|
Reference in New Issue
Block a user