[ADF-3308] ProcessList Component - Provide a way to filter the list by fields (#3629)

* [ADF-3308] Removed name input added two inputs

* * [ADF-3308] Modified demo component

* [ADF-3367] Modified docs

* [ADF-3308] Added tests

* [ADF-3308] Deprecated processDefinitionKey property
This commit is contained in:
Deepak Paul
2018-08-01 14:09:53 +05:30
committed by Eugenio Romano
parent 7173a620de
commit 50e5e7a36a
9 changed files with 158 additions and 38 deletions

View File

@@ -481,9 +481,9 @@ describe('ProcessInstanceListComponent', () => {
component.ngOnChanges({'sort': change});
});
it('should reload the process list when the name parameter changes', (done) => {
const name = 'FakeTaskName';
let change = new SimpleChange(null, name, true);
it('should reload the process list when the processDefinitionKey parameter changes', (done) => {
const processDefinitionKey = 'SimpleProcess';
let change = new SimpleChange(null, processDefinitionKey, true);
component.success.subscribe((res) => {
expect(res).toBeDefined();
@@ -494,7 +494,87 @@ describe('ProcessInstanceListComponent', () => {
done();
});
component.ngOnChanges({'name': change});
component.ngOnChanges({'processDefinitionKey': change});
});
it('should reload the process list when the processDefinitionKey parameter changes to null', (done) => {
const processDefinitionKey = null;
let change = new SimpleChange('SimpleProcess', processDefinitionKey, false);
component.success.subscribe((res) => {
expect(res).toBeDefined();
expect(component.data).toBeDefined();
expect(component.isListEmpty()).not.toBeTruthy();
expect(component.data.getRows().length).toEqual(2);
expect(component.data.getRows()[0].getValue('name')).toEqual('Process 773443333');
done();
});
component.ngOnChanges({'processDefinitionKey': change});
});
it('should reload the process list when the processDefinitionId parameter changes', (done) => {
const processDefinitionId = 'SimpleProcess:1:10';
let change = new SimpleChange(null, processDefinitionId, true);
component.success.subscribe((res) => {
expect(res).toBeDefined();
expect(component.data).toBeDefined();
expect(component.isListEmpty()).not.toBeTruthy();
expect(component.data.getRows().length).toEqual(2);
expect(component.data.getRows()[0].getValue('name')).toEqual('Process 773443333');
done();
});
component.ngOnChanges({'processDefinitionId': change});
});
it('should reload the process list when the processDefinitionId parameter changes to null', (done) => {
const processDefinitionId = null;
let change = new SimpleChange('SimpleProcess:1:10', processDefinitionId, false);
component.success.subscribe((res) => {
expect(res).toBeDefined();
expect(component.data).toBeDefined();
expect(component.isListEmpty()).not.toBeTruthy();
expect(component.data.getRows().length).toEqual(2);
expect(component.data.getRows()[0].getValue('name')).toEqual('Process 773443333');
done();
});
component.ngOnChanges({'processDefinitionId': change});
});
it('should reload the process list when the processInstanceId parameter changes', (done) => {
const processInstanceId = '123';
let change = new SimpleChange(null, processInstanceId, true);
component.success.subscribe((res) => {
expect(res).toBeDefined();
expect(component.data).toBeDefined();
expect(component.isListEmpty()).not.toBeTruthy();
expect(component.data.getRows().length).toEqual(2);
expect(component.data.getRows()[0].getValue('name')).toEqual('Process 773443333');
done();
});
component.ngOnChanges({'processInstanceId': change});
});
it('should reload the process list when the processInstanceId parameter changes to null', (done) => {
const processInstanceId = null;
let change = new SimpleChange('123', processInstanceId, false);
component.success.subscribe((res) => {
expect(res).toBeDefined();
expect(component.data).toBeDefined();
expect(component.isListEmpty()).not.toBeTruthy();
expect(component.data.getRows().length).toEqual(2);
expect(component.data.getRows()[0].getValue('name')).toEqual('Process 773443333');
done();
});
component.ngOnChanges({'processInstanceId': change});
});
});
});