[AAE-3908] - fix clear value icon on card view text item (#6269)

This commit is contained in:
Silviu Popa
2020-10-20 18:49:16 +03:00
committed by GitHub
parent 072f910452
commit 80fc239461
3 changed files with 21 additions and 1 deletions

View File

@@ -393,6 +393,25 @@ describe('CardViewTextItemComponent', () => {
fixture.detectChanges();
expect(clipboardService.copyContentToClipboard).toHaveBeenCalledWith('myValueToCopy', 'CORE.METADATA.ACCESSIBILITY.COPY_TO_CLIPBOARD_MESSAGE');
});
it('should clear value when clear value icon is clicked', async () => {
component.property.value = 'testValue';
component.property.icon = 'FAKE_ICON';
component.property.clickable = true;
component.property.editable = true;
component.editable = true;
component.property.isValid = () => true;
fixture.detectChanges();
await fixture.whenStable();
fixture.detectChanges();
const clickEl = fixture.debugElement.query(By.css(`.adf-property-clear-value`));
clickEl.triggerEventHandler('click', new MouseEvent('click'));
fixture.detectChanges();
const elementValue = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`));
expect(elementValue.nativeElement.textContent).toEqual('');
});
});
describe('Update', () => {