Add typeahead unit test for start process cloud component (#4869)

This commit is contained in:
davidcanonieto
2019-06-20 14:06:01 +01:00
committed by Eugenio Romano
parent 82d6ebd763
commit 685404432a

View File

@@ -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 });
fixture.detectChanges();
fixture.whenStable().then(() => {
@@ -402,6 +402,23 @@ describe('StartProcessCloudComponent', () => {
tick(3000);
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', () => {
@@ -487,7 +504,7 @@ describe('StartProcessCloudComponent', () => {
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['processDefinition'].setValue('NewProcess 1');