[AAE-865]Create card view text item PO (#5320)

* Create card view text item PO

* Changed back the puppeteer version

* Fix the rootElement locator

* no message

* Fix wrong rebase

* * Added unique data-automation-id on cardViewTextComponent.

* Changed data-automation-id for float
This commit is contained in:
cristinaj
2019-12-19 10:50:34 +02:00
committed by Eugenio Romano
parent dead0087f4
commit 5c1f02a1fd
8 changed files with 139 additions and 55 deletions

View File

@@ -5,7 +5,7 @@
<span *ngIf="showProperty()" class="adf-textitem-ellipsis">{{ property.displayValue }}</span>
</span>
<ng-template #elseBlock>
<div role="button" class="adf-textitem-clickable" (click)="clicked()" fxLayout="row" fxLayoutAlign="space-between center">
<div role="button" class="adf-textitem-clickable" [attr.data-automation-id]="'card-textitem-toggle-' + property.key" (click)="clicked()" fxLayout="row" fxLayoutAlign="space-between center">
<span class="adf-textitem-clickable-value" [attr.data-automation-id]="'card-textitem-value-' + property.key">
<span *ngIf="showProperty(); else elseEmptyValueBlock">{{ property.displayValue }}</span>
</span>
@@ -27,7 +27,7 @@
(click)="setEditMode(true)"
(keydown.enter)="setEditMode(true)"
class="adf-textitem-readonly"
[attr.data-automation-id]="'card-textitem-edit-toggle-' + property.key"
[attr.data-automation-id]="'card-textitem-toggle-' + property.key"
fxLayout="row" fxLayoutAlign="space-between center">
<span [attr.data-automation-id]="'card-textitem-value-' + property.key">
<span *ngIf="showProperty(); else elseEmptyValueBlock">{{ property.displayValue }}</span>

View File

@@ -375,7 +375,7 @@ describe('CardViewTextItemComponent', () => {
}
);
const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-toggle-${component.property.key}"]`));
const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-toggle-${component.property.key}"]`));
editIcon.nativeElement.dispatchEvent(new MouseEvent('click'));
fixture.detectChanges();
@@ -403,7 +403,7 @@ describe('CardViewTextItemComponent', () => {
}
);
const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-toggle-${component.property.key}"]`));
const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-toggle-${component.property.key}"]`));
editIcon.nativeElement.dispatchEvent(new MouseEvent('click'));
fixture.detectChanges();
@@ -426,7 +426,7 @@ describe('CardViewTextItemComponent', () => {
component.property.isValid = () => true;
fixture.detectChanges();
const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-toggle-${component.property.key}"]`));
const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-toggle-${component.property.key}"]`));
editIcon.nativeElement.dispatchEvent(new MouseEvent('click'));
fixture.detectChanges();