Revert "[ADF-4861] Fix memory leak in Date widgets and Form Cloud Model (#5041)" (#5279)

This reverts commit 2def8d0557.
This commit is contained in:
Denys Vuika
2019-11-22 14:03:49 +00:00
committed by GitHub
parent 1de2ff0cc9
commit 8e6e755ed1
7 changed files with 56 additions and 2 deletions

View File

@@ -80,6 +80,23 @@ describe('DateWidgetComponent', () => {
expect(widget.maxDate.isSame(expected)).toBeTruthy();
});
it('should eval visibility on date changed', () => {
spyOn(widget, 'onFieldChanged').and.callThrough();
const field = new FormFieldModel(new FormModel(), {
id: 'date-field-id',
name: 'date-name',
value: '9999-9-9',
type: 'date',
readOnly: 'false'
});
widget.field = field;
widget.onDateChanged({ value: moment('12/12/2012') });
expect(widget.onFieldChanged).toHaveBeenCalledWith(field);
});
describe('template check', () => {
afterEach(() => {

View File

@@ -86,5 +86,6 @@ export class DateCloudWidgetComponent extends WidgetComponent implements OnInit,
} else {
this.field.value = null;
}
this.onFieldChanged(this.field);
}
}