minor fix e2e and styles

This commit is contained in:
Eugenio Romano
2019-03-29 02:09:07 +00:00
parent 24dfd33544
commit 2e151ed412
7 changed files with 84 additions and 36 deletions

View File

@@ -157,7 +157,24 @@ describe('CardViewTextItemComponent', () => {
expect(value.nativeElement.innerText.trim()).toBe('FAKE-DEFAULT-KEY');
});
it('should render the edit icon in case of clickable true and icon defined', () => {
it('should render the edit icon in case of clickable true and editable true', () => {
component.property = new CardViewTextItemModel({
label: 'Text label',
value: '',
key: 'textkey',
default: 'FAKE-DEFAULT-KEY',
clickable: true,
editable: true,
icon: 'FAKE-ICON'
});
fixture.detectChanges();
let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.icon}"]`));
expect(value).not.toBeNull();
expect(value.nativeElement.innerText.trim()).toBe('FAKE-ICON');
});
it('should not render the edit icon in case of clickable true and icon defined', () => {
component.property = new CardViewTextItemModel({
label: 'Text label',
value: '',
@@ -169,7 +186,7 @@ describe('CardViewTextItemComponent', () => {
fixture.detectChanges();
let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.icon}"]`));
expect(value).not.toBeNull();
expect(value).toBeNull();
expect(value.nativeElement.innerText.trim()).toBe('FAKE-ICON');
});