[ACA-4436] - added option for select item to display None (#7113)

* [ACA-4436] - added option for select item to display None

* [ACA-4436] - added unit test and fixed wrong default behaviour

* [ACA-4436] - fixed property check

* [ACA-4436] - fixed unit test

* [ACA-4436] - fixed unit test
This commit is contained in:
Vito
2021-06-25 10:19:16 +01:00
committed by GitHub
parent 26d180e661
commit 82a57c9c05
8 changed files with 112 additions and 2 deletions

View File

@@ -40,7 +40,22 @@ describe('CardViewSelectItemModel', () => {
itemModel.displayValue.subscribe((value) => {
expect(value).toBe(mockData[1].label);
expect(itemModel.displayNoneOption).toBe(true);
});
}));
it('should set true for none option when passed through the properties', fakeAsync(() => {
properties.displayNoneOption = true;
const itemModel = new CardViewSelectItemModel(properties);
expect(itemModel.displayNoneOption).toBe(true);
}));
it('should set false for none option when passed through the properties', fakeAsync(() => {
properties.displayNoneOption = false;
const itemModel = new CardViewSelectItemModel(properties);
expect(itemModel.displayNoneOption).toBe(false);
}));
});
});