Skip to content

Commit

Permalink
[AAE-3219] Start process button is disabled when page is first displa…
Browse files Browse the repository at this point in the history
…yed (#5955)
  • Loading branch information
mcchrys authored Aug 5, 2020
1 parent 5e19d48 commit 700c065
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 700c065

Please sign in to comment.