Added other tests

This commit is contained in:
Vito Albano
2016-08-21 01:45:07 +01:00
parent 0fbaf7faf0
commit 57196ca50a
2 changed files with 94 additions and 234 deletions

View File

@@ -571,12 +571,12 @@ describe('ActivitiForm', () => {
expect(formComponent.getFormDefinitionOutcomes).toHaveBeenCalledWith(form);
});
it('should update the visibility when the container raise the change event', (done) => {
it('should update the visibility when the container raise the change event', (valueChanged) => {
spyOn(formComponent, 'checkVisibility').and.callThrough();
let widget = new ContainerWidget();
let fakeForm = new FormModel();
let fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'});
widget.formValueChanged.subscribe(field => { console.log('called'); done(); });
widget.formValueChanged.subscribe(field => { valueChanged(); });
widget.fieldChanged(fakeField);
expect(formComponent.checkVisibility).toHaveBeenCalledWith(fakeField);