mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Add typeahead unit test for start process cloud component (#4869)
This commit is contained in:
committed by
Eugenio Romano
parent
82d6ebd763
commit
685404432a
@@ -372,7 +372,7 @@ describe('StartProcessCloudComponent', () => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should reload processes when appId input changed', async(() => {
|
it('should reload processes when appName input changed', async(() => {
|
||||||
component.ngOnChanges({ appName: change });
|
component.ngOnChanges({ appName: change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
@@ -402,6 +402,23 @@ describe('StartProcessCloudComponent', () => {
|
|||||||
tick(3000);
|
tick(3000);
|
||||||
expect(component.filteredProcesses.length).toEqual(1);
|
expect(component.filteredProcesses.length).toEqual(1);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should display the matching results in the dropdown as the user types down', fakeAsync(() => {
|
||||||
|
component.processDefinitionList = fakeProcessDefinitions;
|
||||||
|
component.ngOnInit();
|
||||||
|
component.ngOnChanges({ appName: change });
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
component.processForm.controls['processDefinition'].setValue('process');
|
||||||
|
fixture.detectChanges();
|
||||||
|
tick(3000);
|
||||||
|
expect(component.filteredProcesses.length).toEqual(3);
|
||||||
|
|
||||||
|
component.processForm.controls['processDefinition'].setValue('processwithfo');
|
||||||
|
fixture.detectChanges();
|
||||||
|
tick(3000);
|
||||||
|
expect(component.filteredProcesses.length).toEqual(1);
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('start process', () => {
|
describe('start process', () => {
|
||||||
@@ -487,7 +504,7 @@ describe('StartProcessCloudComponent', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should able to start the process when the required fields are filled up', (done) => {
|
it('should be able to start the process when the required fields are filled up', (done) => {
|
||||||
component.processForm.controls['processInstanceName'].setValue('My Process 1');
|
component.processForm.controls['processInstanceName'].setValue('My Process 1');
|
||||||
component.processForm.controls['processDefinition'].setValue('NewProcess 1');
|
component.processForm.controls['processDefinition'].setValue('NewProcess 1');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user