mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4782] VisibilityConditions - fix chaining conditions (#4971)
* [ADF-4782] VisibilityConditions - fix chaining conditions * add return types
This commit is contained in:
committed by
Eugenio Romano
parent
0bca6607a9
commit
bf828b6389
@@ -34,7 +34,7 @@ import { AlfrescoApiServiceMock } from '../../mock/alfresco-api.service.mock';
|
||||
import {
|
||||
fakeFormJson, fakeTaskProcessVariableModels,
|
||||
formTest, formValues, complexVisibilityJsonVisible,
|
||||
complexVisibilityJsonNotVisible } from 'core/mock/form/widget-visibility-cloud.service.mock';
|
||||
nextConditionForm, complexVisibilityJsonNotVisible } from 'core/mock/form/widget-visibility-cloud.service.mock';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -187,6 +187,23 @@ describe('WidgetVisibilityCloudService', () => {
|
||||
booleanResult = service.evaluateCondition(null, null, undefined);
|
||||
expect(booleanResult).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should evaluate true visibility condition with next condition operator', (done) => {
|
||||
const myForm = new FormModel(nextConditionForm);
|
||||
service.refreshVisibility(myForm);
|
||||
const nextConditionFormVIsibility = myForm.getFieldById('Text4');
|
||||
expect(nextConditionFormVIsibility.isVisible).toBeTruthy();
|
||||
done();
|
||||
});
|
||||
|
||||
it('should evaluate false visibility condition with next condition operator', (done) => {
|
||||
const myForm = new FormModel(nextConditionForm);
|
||||
myForm.getFieldById('Text3').value = 'wrong value';
|
||||
service.refreshVisibility(myForm);
|
||||
const nextConditionFormVIsibility = myForm.getFieldById('Text4');
|
||||
expect(nextConditionFormVIsibility.isVisible).toBeFalsy();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe('should retrieve the process variables', () => {
|
||||
|
Reference in New Issue
Block a user