[AAE-485] Fix card view int item validator (#5135)

* [AAE-485] Fix card view int item validator

* Improve code

* Fix unit tests

* Remove outdated test

* Fix login of int validator

* Fix e2e test

* fix linting
This commit is contained in:
davidcanonieto
2019-10-21 11:18:55 +01:00
committed by Eugenio Romano
parent f2c1778eda
commit 2a033507b3
6 changed files with 14 additions and 69 deletions

View File

@@ -77,22 +77,6 @@ describe('CardViewTextItemComponent', () => {
expect(value.nativeElement.innerText.trim()).toBe('User Name');
});
it('should NOT render the default as value if the value is empty, editable is false and displayEmpty is false', () => {
component.property = new CardViewTextItemModel({
label: 'Text label',
value: '',
key: 'textkey',
default: 'FAKE-DEFAULT-KEY',
editable: false
});
component.displayEmpty = false;
fixture.detectChanges();
const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`));
expect(value).not.toBeNull();
expect(value.nativeElement.innerText.trim()).toBe('');
});
it('should render the default as value if the value is empty, editable is false and displayEmpty is true', () => {
component.property = new CardViewTextItemModel({
label: 'Text label',
@@ -125,22 +109,6 @@ describe('CardViewTextItemComponent', () => {
expect(value.nativeElement.innerText.trim()).toBe('FAKE-DEFAULT-KEY');
});
it('should NOT render the default as value if the value is empty, clickable is false and displayEmpty is false', () => {
component.property = new CardViewTextItemModel({
label: 'Text label',
value: '',
key: 'textkey',
default: 'FAKE-DEFAULT-KEY',
clickable: false
});
component.displayEmpty = false;
fixture.detectChanges();
const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`));
expect(value).not.toBeNull();
expect(value.nativeElement.innerText.trim()).toBe('');
});
it('should render the default as value if the value is empty, clickable is false and displayEmpty is true', () => {
component.property = new CardViewTextItemModel({
label: 'Text label',