mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-42658 Remove check for outcome.id as name based outcomes are valid (#11685)
This commit is contained in:
@@ -223,7 +223,7 @@ export abstract class FormBaseComponent {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Note: Activiti is using NAME field rather than ID for outcomes
|
// Note: Activiti is using NAME field rather than ID for outcomes
|
||||||
if (outcome.name && outcome.id) {
|
if (outcome.name) {
|
||||||
this.completeTaskForm(outcome.name, outcome.id);
|
this.completeTaskForm(outcome.name, outcome.id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -610,6 +610,19 @@ describe('FormCloudComponent', () => {
|
|||||||
expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, outcomeId);
|
expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, outcomeId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should complete form on custom outcome click when id is null (APS)', () => {
|
||||||
|
const formModel = new FormModel();
|
||||||
|
const outcomeName = 'Custom Action';
|
||||||
|
const outcome = new FormOutcomeModel(formModel, { name: outcomeName, id: null });
|
||||||
|
|
||||||
|
formComponent.form = formModel;
|
||||||
|
spyOn(formComponent, 'completeTaskForm').and.stub();
|
||||||
|
|
||||||
|
const result = formComponent.onOutcomeClicked(outcome);
|
||||||
|
expect(result).toBeTruthy();
|
||||||
|
expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, null);
|
||||||
|
});
|
||||||
|
|
||||||
it('should save form on [save] outcome click', () => {
|
it('should save form on [save] outcome click', () => {
|
||||||
const formModel = new FormModel();
|
const formModel = new FormModel();
|
||||||
const outcome = new FormOutcomeModel(formModel, {
|
const outcome = new FormOutcomeModel(formModel, {
|
||||||
|
|||||||
@@ -350,6 +350,19 @@ describe('FormComponent', () => {
|
|||||||
expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, outcome.id);
|
expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, outcome.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should complete form on custom outcome click when id is null (APS)', () => {
|
||||||
|
const formModel = new FormModel();
|
||||||
|
const outcomeName = 'Custom Action';
|
||||||
|
const outcome = new FormOutcomeModel(formModel, { name: outcomeName, id: null });
|
||||||
|
|
||||||
|
formComponent.form = formModel;
|
||||||
|
spyOn(formComponent, 'completeTaskForm').and.stub();
|
||||||
|
|
||||||
|
const result = formComponent.onOutcomeClicked(outcome);
|
||||||
|
expect(result).toBeTruthy();
|
||||||
|
expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName, null);
|
||||||
|
});
|
||||||
|
|
||||||
it('should save form on [save] outcome click', () => {
|
it('should save form on [save] outcome click', () => {
|
||||||
const formModel = new FormModel();
|
const formModel = new FormModel();
|
||||||
const outcome = new FormOutcomeModel(formModel, {
|
const outcome = new FormOutcomeModel(formModel, {
|
||||||
|
|||||||
Reference in New Issue
Block a user