mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-5004] [CardViewTextItemComponent] Provide a way to have an icon for the clickable items (#5270)
* [ADF-5004] [CardViewTextItemComponent] Provide a way to have an icon for the clickable items. * * FIxed failing unit tests* Modified task-details tests and add few more.
This commit is contained in:
committed by
Maurizio Vitale
parent
e806e97c75
commit
5068cbf539
@@ -154,6 +154,54 @@ describe('CardViewTextItemComponent', () => {
|
||||
expect(value).toBeNull();
|
||||
});
|
||||
|
||||
it('should not render the clickable icon in case editable set to false', () => {
|
||||
component.property = new CardViewTextItemModel({
|
||||
label: 'Text label',
|
||||
value: '',
|
||||
key: 'textkey',
|
||||
default: 'FAKE-DEFAULT-KEY',
|
||||
clickable: true,
|
||||
icon: 'create'
|
||||
});
|
||||
component.editable = false;
|
||||
fixture.detectChanges();
|
||||
|
||||
const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-clickable-icon-textkey"]`));
|
||||
expect(value).toBeNull('icon should NOT be shown');
|
||||
});
|
||||
|
||||
it('should render the defined clickable icon in case of clickable true and editable input set to true', () => {
|
||||
component.property = new CardViewTextItemModel({
|
||||
label: 'Text label',
|
||||
value: '',
|
||||
key: 'textkey',
|
||||
default: 'FAKE-DEFAULT-KEY',
|
||||
clickable: true,
|
||||
icon: 'FAKE_ICON'
|
||||
});
|
||||
component.editable = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-clickable-icon-textkey"]`));
|
||||
expect(value).not.toBeNull();
|
||||
expect(value.nativeElement.innerText).toBe('FAKE_ICON');
|
||||
});
|
||||
|
||||
it('should not render clickable icon in case of clickable true and icon undefined', () => {
|
||||
component.property = new CardViewTextItemModel({
|
||||
label: 'Text label',
|
||||
value: '',
|
||||
key: 'textkey',
|
||||
default: 'FAKE-DEFAULT-KEY',
|
||||
clickable: true
|
||||
});
|
||||
component.editable = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-clickable-icon-textkey"]`));
|
||||
expect(value).toBeNull('icon should NOT be shown');
|
||||
});
|
||||
|
||||
it('should not render the edit icon in case of clickable true and icon undefined', () => {
|
||||
component.property = new CardViewTextItemModel({
|
||||
label: 'Text label',
|
||||
|
Reference in New Issue
Block a user