* Fixed theaming issue on the filters* Fixed fixed clear action default value. (#4980)

This commit is contained in:
siva kumar
2019-08-08 00:18:06 +05:30
committed by Eugenio Romano
parent e4426e61a0
commit d51e22f9f4
3 changed files with 40 additions and 11 deletions

View File

@@ -107,6 +107,7 @@ describe('CardViewDateItemComponent', () => {
format: '',
editable: true
});
component.displayClearAction = false;
component.editable = true;
fixture.detectChanges();
@@ -205,7 +206,7 @@ describe('CardViewDateItemComponent', () => {
);
}));
it('should render the clear icon in case of editable:true', () => {
it('should render the clear icon in case of displayClearAction:true', () => {
component.editable = true;
component.property.editable = true;
component.property.value = 'Jul 10 2017';
@@ -225,7 +226,7 @@ describe('CardViewDateItemComponent', () => {
expect(datePickerClearToggle).toBeNull('Clean Icon should not be in DOM');
});
it('should not render the clear icon in case displayClearAction is set false', () => {
it('should not render the clear icon in case of displayClearAction:false', () => {
component.editable = true;
component.property.editable = true;
component.displayClearAction = false;
@@ -250,4 +251,36 @@ describe('CardViewDateItemComponent', () => {
}
);
}));
it('should remove the property default value after a successful clear attempt', async(() => {
component.editable = true;
component.property.editable = true;
component.property.default = 'Jul 10 2017';
fixture.detectChanges();
component.onDateClear();
fixture.whenStable().then(
(updateNotification) => {
expect(component.property.default).toBeNull();
}
);
}));
it('should remove actual and default value after a successful clear attempt', async(() => {
component.editable = true;
component.property.editable = true;
component.property.default = 'Jul 10 2017';
component.property.value = 'Jul 10 2017';
fixture.detectChanges();
component.onDateClear();
fixture.whenStable().then(
(updateNotification) => {
expect(component.property.value).toBeNull();
expect(component.property.default).toBeNull();
}
);
}));
});