mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[MNT-22003] - fixed check on variable for visibility service (#6306)
* [MNT-22003] - fixed check on variable for visibility service * [MNT-22003] - update variable for test * [MNT-22003] - added extra unit test for checking the process variable passed Co-authored-by: Vito Albano <vitoalbano@vitoalbano-mbp-0120.local>
This commit is contained in:
@@ -205,7 +205,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
this.data = data[1];
|
||||
|
||||
const parsedForm = this.parseForm(this.formCloudRepresentationJSON);
|
||||
this.visibilityService.refreshVisibility(<any> parsedForm);
|
||||
this.visibilityService.refreshVisibility(<any> parsedForm, this.data);
|
||||
parsedForm.validateForm();
|
||||
this.form = parsedForm;
|
||||
this.form.nodeId = '-my-';
|
||||
|
@@ -18,8 +18,12 @@
|
||||
export class TaskVariableCloud {
|
||||
name: string;
|
||||
value: any;
|
||||
type: string;
|
||||
id: string;
|
||||
constructor(obj) {
|
||||
this.id = obj.name || null;
|
||||
this.name = obj.name || null;
|
||||
this.value = obj.value || null;
|
||||
this.type = obj.type || null;
|
||||
}
|
||||
}
|
||||
|
@@ -264,7 +264,8 @@ describe('StartProcessCloudComponent', () => {
|
||||
it('should be able to start a process with a prefilled valid form', fakeAsync(() => {
|
||||
component.processDefinitionName = 'processwithform';
|
||||
getDefinitionsSpy.and.returnValue(of(fakeSingleProcessDefinition(component.processDefinitionName)));
|
||||
component.values = [{ 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
component.values = [{'id': '1', 'type': 'string', 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
'id': '1', 'type': 'string',
|
||||
'name': 'lastName',
|
||||
'value': 'FakeLastName'
|
||||
}];
|
||||
@@ -298,7 +299,8 @@ describe('StartProcessCloudComponent', () => {
|
||||
it('should NOT be able to start a process with a prefilled NOT valid form', fakeAsync(() => {
|
||||
component.processDefinitionName = 'processwithform';
|
||||
getDefinitionsSpy.and.returnValue(of(fakeSingleProcessDefinition(component.processDefinitionName)));
|
||||
component.values = [{ 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
component.values = [{ 'id': '1', 'type': 'string', 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
'id': '1', 'type': 'string',
|
||||
'name': 'lastName',
|
||||
'value': 'FakeLastName'
|
||||
}];
|
||||
@@ -331,7 +333,8 @@ describe('StartProcessCloudComponent', () => {
|
||||
}));
|
||||
|
||||
it('should create a process instance if the selection is valid', fakeAsync(() => {
|
||||
component.values = [{ 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
component.values = [{ 'id': '1', 'type': 'string', 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
'id': '1', 'type': 'string',
|
||||
'name': 'lastName',
|
||||
'value': 'FakeLastName'
|
||||
}];
|
||||
@@ -362,7 +365,8 @@ describe('StartProcessCloudComponent', () => {
|
||||
}));
|
||||
|
||||
it('should have start button enabled when default values are set', fakeAsync(() => {
|
||||
component.values = [{ 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
component.values = [{ 'id': '1', 'type': 'string', 'name': 'firstName', 'value': 'FakeName' }, {
|
||||
'id': '1', 'type': 'string',
|
||||
'name': 'lastName',
|
||||
'value': 'FakeLastName'
|
||||
}];
|
||||
|
Reference in New Issue
Block a user