mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1923] Form APS E2E (#5540)
* [AAE-1923] Form APS E2E * * minor changes * * fixed e2e
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
<input matInput
|
||||
class="adf-input"
|
||||
type="text"
|
||||
data-automation-id="adf-group-search-input"
|
||||
[id]="field.id"
|
||||
[(ngModel)]="value"
|
||||
(keyup)="onKeyUp($event)"
|
||||
@@ -13,10 +14,10 @@
|
||||
placeholder="{{field.placeholder}}"
|
||||
[matAutocomplete]="auto">
|
||||
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="onItemSelect($event.option.value)">
|
||||
<mat-option *ngFor="let item of groups"
|
||||
<mat-option *ngFor="let item of groups; let i = index" id="adf-group-widget-user-{{i}}"
|
||||
[id]="field.id +'-'+item.id"
|
||||
(click)="onItemClick(item, $event)" [value]="item">
|
||||
<span>{{item.name}}</span>
|
||||
<span id="adf-group-label-name">{{item.name}}</span>
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
|
||||
|
@@ -13,11 +13,12 @@
|
||||
(ngModelChange)="validate()"
|
||||
(keyup)="onKeyUp($event)"
|
||||
[disabled]="field.readOnly"
|
||||
data-automation-id="adf-typeahed-search-input"
|
||||
placeholder="{{field.placeholder}}"
|
||||
[matAutocomplete]="auto">
|
||||
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="onItemSelect($event.option.value)">
|
||||
<mat-option *ngFor="let item of options" [value]="item">
|
||||
<span [id]="field.name+'_option_'+item.id">{{item.name}}</span>
|
||||
<mat-option *ngFor="let item of options; let i = index" id="adf-typeahed-widget-user-{{i}}" [value]="item">
|
||||
<span id="adf-typeahed-label-name">{{item.name}}</span>
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
</mat-form-field>
|
||||
|
@@ -304,9 +304,9 @@ describe('TypeaheadWidgetComponent', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('[id="typeahead-name_option_1"]'))).not.toBeNull();
|
||||
expect(fixture.debugElement.query(By.css('[id="typeahead-name_option_2"]'))).not.toBeNull();
|
||||
expect(fixture.debugElement.query(By.css('[id="typeahead-name_option_3"]'))).not.toBeNull();
|
||||
expect(fixture.debugElement.query(By.css('[id="adf-typeahed-widget-user-0"] span'))).not.toBeNull();
|
||||
expect(fixture.debugElement.query(By.css('[id="adf-typeahed-widget-user-1"] span'))).not.toBeNull();
|
||||
expect(fixture.debugElement.query(By.css('[id="adf-typeahed-widget-user-2"] span'))).not.toBeNull();
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -321,7 +321,7 @@ describe('TypeaheadWidgetComponent', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('[id="typeahead-name_option_1"]'))).not.toBeNull();
|
||||
expect(fixture.debugElement.query(By.css('[id="adf-typeahed-widget-user-0"] span'))).not.toBeNull();
|
||||
typeaheadHTMLElement.focus();
|
||||
typeaheadWidgetComponent.value = '';
|
||||
typeaheadHTMLElement.dispatchEvent(new Event('keyup'));
|
||||
@@ -329,7 +329,7 @@ describe('TypeaheadWidgetComponent', () => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('[id="typeahead-name_option_1"]'))).toBeNull();
|
||||
expect(fixture.debugElement.query(By.css('[id="adf-typeahed-widget-user-0"] span'))).toBeNull();
|
||||
});
|
||||
});
|
||||
}));
|
||||
@@ -377,9 +377,9 @@ describe('TypeaheadWidgetComponent', () => {
|
||||
typeaheadWidgetComponent.onKeyUp(keyboardEvent);
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(fixture.debugElement.queryAll(By.css('[id="mat-option-1"]'))).toBeDefined();
|
||||
expect(fixture.debugElement.queryAll(By.css('[id="mat-option-2"]'))).toBeDefined();
|
||||
expect(fixture.debugElement.queryAll(By.css('[id="mat-option-3"]'))).toBeDefined();
|
||||
expect(fixture.debugElement.queryAll(By.css('[id="adf-typeahed-widget-user-0"] span'))).toBeDefined();
|
||||
expect(fixture.debugElement.queryAll(By.css('[id="adf-typeahed-widget-user-1"] span'))).toBeDefined();
|
||||
expect(fixture.debugElement.queryAll(By.css('[id="adf-typeahed-widget-user-2"] span'))).toBeDefined();
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
Reference in New Issue
Block a user