Revert "autocomplete component added (#3701)"

This reverts commit 21d7a8aec2.
This commit is contained in:
davidcanonieto
2018-09-14 10:05:59 +01:00
committed by GitHub
parent 23266fa23c
commit 13ff89ee8c
6 changed files with 33 additions and 81 deletions

View File

@@ -143,7 +143,7 @@ describe('StartFormComponent', () => {
});
}));
it('should have start button disabled if the process is not selected', async(() => {
it('should have start button disabled if the process is not seleted', async(() => {
component.name = 'My new process';
fixture.detectChanges();
fixture.whenStable().then(() => {
@@ -154,7 +154,7 @@ describe('StartFormComponent', () => {
it('should emit cancel event on cancel Button', async(() => {
fixture.detectChanges();
let cancelButton = fixture.nativeElement.querySelector('#cancel_process');
let cancelButton = fixture.nativeElement.querySelector('#cancle_process');
let cancelSpy: jasmine.Spy = spyOn(component.cancel, 'emit');
cancelButton.click();
fixture.detectChanges();
@@ -222,7 +222,8 @@ describe('StartFormComponent', () => {
component.ngOnChanges({});
fixture.detectChanges();
expect(component.processDefinitions.length).toBe(2);
let selectElement = fixture.nativeElement.querySelector('mat-select');
expect(selectElement.children.length).toBe(1);
});
it('should display the option def details', () => {
@@ -231,7 +232,7 @@ describe('StartFormComponent', () => {
component.processDefinitions = testMultipleProcessDefs;
fixture.detectChanges();
fixture.whenStable().then(() => {
let selectElement = fixture.nativeElement.querySelector('mat-autocomplete');
let selectElement = fixture.nativeElement.querySelector('mat-select > .mat-select-trigger');
let optionElement = fixture.nativeElement.querySelectorAll('mat-option');
selectElement.click();
expect(selectElement).not.toBeNull();
@@ -241,7 +242,7 @@ describe('StartFormComponent', () => {
});
});
it('should indicate an error to the user if process definitions cannot be loaded', async(() => {
it('should indicate an error to the user if process defs cannot be loaded', async(() => {
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(throwError({}));
component.appId = 123;
component.ngOnChanges({});
@@ -278,7 +279,7 @@ describe('StartFormComponent', () => {
});
}));
it('should select automatically the processDefinition if the app contain only one', async(() => {
it('should select automatically the processDefinition if the app contain oly one', async(() => {
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(of(testProcessDefinitions));
component.appId = 123;
component.ngOnChanges({});
@@ -288,17 +289,6 @@ describe('StartFormComponent', () => {
});
}));
it('should have start button enabled when process is selected', async(() => {
component.selectedProcessDef = testProcessDefRepr;
component.name = 'My process';
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
let startBtn = fixture.nativeElement.querySelector('#button-start');
expect(startBtn.disabled).toBe(false);
});
}));
describe('dropdown', () => {
it('should hide the process dropdown if showSelectProcessDropdown is false', async(() => {
@@ -308,12 +298,12 @@ describe('StartFormComponent', () => {
component.ngOnChanges({});
fixture.detectChanges();
fixture.whenStable().then(() => {
let selectElement = fixture.nativeElement.querySelector('mat-autocomplete');
let selectElement = fixture.nativeElement.querySelector('mat-select > .mat-select-trigger');
expect(selectElement).toBeNull();
});
}));
it('should show the process dropdown if showSelectProcessDropdown is true', async(() => {
it('should show the process dropdown if showSelectProcessDropdown is false', async(() => {
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(of(testMultipleProcessDefs));
component.appId = 123;
component.processDefinitionName = 'My Process 2';
@@ -321,7 +311,7 @@ describe('StartFormComponent', () => {
component.ngOnChanges({});
fixture.detectChanges();
fixture.whenStable().then(() => {
let selectElement = fixture.nativeElement.querySelector('mat-autocomplete');
let selectElement = fixture.nativeElement.querySelector('mat-select > .mat-select-trigger');
expect(selectElement).not.toBeNull();
});
}));
@@ -333,7 +323,7 @@ describe('StartFormComponent', () => {
component.ngOnChanges({});
fixture.detectChanges();
fixture.whenStable().then(() => {
let selectElement = fixture.nativeElement.querySelector('mat-autocomplete');
let selectElement = fixture.nativeElement.querySelector('mat-select > .mat-select-trigger');
expect(selectElement).not.toBeNull();
});
}));
@@ -361,7 +351,7 @@ describe('StartFormComponent', () => {
});
}));
it('should get current processDef', () => {
it('should get current processDeff', () => {
component.appId = 456;
component.ngOnChanges({ appId: change });
fixture.detectChanges();
@@ -402,7 +392,7 @@ describe('StartFormComponent', () => {
});
}));
it('should call service to start process with the variables set up', async(() => {
it('should call service to start process with the variables setted', async(() => {
let inputProcessVariable: ProcessInstanceVariable[] = [];
let variable: ProcessInstanceVariable = {};