#1631 Should create an empty form when the process definitions are empty (#1633)

This commit is contained in:
Maurizio Vitale
2017-02-15 11:42:48 +00:00
committed by Vito
parent e3cbff0e35
commit c1493315bf
4 changed files with 29 additions and 0 deletions

View File

@@ -342,6 +342,24 @@ describe('AnalyticsReportParametersComponent', () => {
});
it('Should create an empty valid form when there are no parameters definitions', () => {
component.onSuccess.subscribe((res) => {
expect(component.reportForm).toBeDefined();
expect(component.reportForm.valid).toEqual(true);
expect(component.reportForm.controls).toEqual({});
});
let reportId = 1;
let change = new SimpleChange(null, reportId);
component.ngOnChanges({ 'reportId': change });
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200,
contentType: 'json',
responseText: analyticParamsMock.reportNoParameterDefinitions
});
});
it('Should load the task list when a process definition is selected', () => {
component.onSuccessReportParams.subscribe((res) => {
expect(res).toBeDefined();