mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Fix Start Process button for processes without a start form (#1391)
Refs #1390
This commit is contained in:
parent
f89fe8e50a
commit
560d1bcd7f
@ -231,6 +231,8 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
component.name = 'My new process';
|
component.name = 'My new process';
|
||||||
|
let change = new SimpleChange(null, '123');
|
||||||
|
component.ngOnChanges({ 'appId': change });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.onProcessDefChange('my:process1');
|
component.onProcessDefChange('my:process1');
|
||||||
fixture.whenStable();
|
fixture.whenStable();
|
||||||
@ -243,14 +245,15 @@ describe('ActivitiStartProcessInstance', () => {
|
|||||||
expect(startBtn.properties['disabled']).toBe(true);
|
expect(startBtn.properties['disabled']).toBe(true);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should have start button disabled when name not filled out', async(() => {
|
it('should have start button disabled when no process is selected', async(() => {
|
||||||
component.onProcessDefChange('');
|
component.onProcessDefChange('');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(startBtn.properties['disabled']).toBe(true);
|
expect(startBtn.properties['disabled']).toBe(true);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
xit('should enable start button when name and process filled out', async(() => {
|
it('should enable start button when name and process filled out', async(() => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
startBtn = debugElement.query(By.css('[data-automation-id="btn-start"]'));
|
||||||
expect(startBtn.properties['disabled']).toBe(false);
|
expect(startBtn.properties['disabled']).toBe(false);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -115,10 +115,10 @@ export class ActivitiStartProcessInstance implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isStartFormMissingOrValid() {
|
isStartFormMissingOrValid() {
|
||||||
if (this.startForm && this.startForm.form && this.startForm.form.isValid) {
|
if (this.startForm) {
|
||||||
return !this.startForm || this.startForm.form.isValid;
|
return this.startForm.form && this.startForm.form.isValid;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user