mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-3219] Start process button is disabled when page is first displayed (#5955)
This commit is contained in:
@@ -360,6 +360,29 @@ describe('StartProcessCloudComponent', () => {
|
||||
expect(component.currentCreatedProcess.startDate).toBeNull();
|
||||
});
|
||||
}));
|
||||
|
||||
it('should have start button enabled when default values are set', fakeAsync(() => {
|
||||
component.values = [{ 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
'name': 'lastName',
|
||||
'value': 'FakeLastName'
|
||||
}];
|
||||
component.name = 'testFormWithProcess';
|
||||
component.processDefinitionName = 'processwithoutform2';
|
||||
getDefinitionsSpy.and.returnValue(of(fakeSingleProcessDefinition(component.processDefinitionName)));
|
||||
fixture.detectChanges();
|
||||
formDefinitionSpy = spyOn(formCloudService, 'getForm').and.returnValue(of(fakeStartForm));
|
||||
|
||||
const change = new SimpleChange(null, 'MyApp', true);
|
||||
component.ngOnChanges({ 'appName': change });
|
||||
fixture.detectChanges();
|
||||
tick(450);
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
const startBtn = fixture.nativeElement.querySelector('#button-start');
|
||||
expect(startBtn.disabled).toBe(false);
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
describe('process definitions list', () => {
|
||||
|
@@ -126,7 +126,7 @@ export class StartProcessCloudComponent implements OnChanges, OnInit, OnDestroy
|
||||
|
||||
this.processForm.valueChanges
|
||||
.pipe(
|
||||
debounceTime(200),
|
||||
debounceTime(400),
|
||||
tap(() => this.disableStartButton = true),
|
||||
distinctUntilChanged(),
|
||||
filter(() => this.isProcessSelectionValid()),
|
||||
|
Reference in New Issue
Block a user