[ACS-3497] - Fix accessibility issues in ACA personal files (#7833)

This commit is contained in:
MichalKinas
2022-09-21 16:08:57 +02:00
committed by GitHub
parent 3180ad3fe0
commit c5ee606cb4
15 changed files with 40 additions and 40 deletions

View File

@@ -72,7 +72,7 @@
role="navigation"
[attr.aria-label]="'BREADCRUMB.ARIA-LABEL.BREADCRUMB' | translate"
>
<div class="adf-breadcrumb-item adf-active" role="listitem">
<div class="adf-breadcrumb-item adf-active" role="group">
<div class="adf-breadcrumb-item-current" role="heading" aria-level="2">
{{ root | translate }}
</div>

View File

@@ -63,7 +63,7 @@ describe('UserIconColumnComponent', () => {
};
component.ngOnInit();
fixture.detectChanges();
expect(element.querySelector('[id="user-initials-image"]').textContent).toContain('fu');
expect(element.querySelector('[data-automation-id="user-initials-image"]').textContent).toContain('fu');
});
it('should render person value from node', () => {
@@ -80,7 +80,7 @@ describe('UserIconColumnComponent', () => {
} as NodeEntry;
component.ngOnInit();
fixture.detectChanges();
expect(element.querySelector('[id="user-initials-image"]').textContent).toContain('FU');
expect(element.querySelector('[data-automation-id="user-initials-image"]').textContent).toContain('FU');
});
});

View File

@@ -2,7 +2,7 @@
class="adf-filter">
<button mat-icon-button
[matMenuTriggerFor]="filter"
id="filter-menu-button"
data-automation-id="filter-menu-button"
#menuTrigger="matMenuTrigger"
(click)="$event.stopPropagation()"
(menuOpened)="onMenuOpen()"
@@ -22,6 +22,7 @@
class="adf-filter-menu"
(closed)="onClosed()">
<div #filterContainer
role="menuitem"
(keydown.tab)="$event.stopPropagation();">
<div (click)="$event.stopPropagation()"
class="adf-filter-container">

View File

@@ -86,7 +86,7 @@ describe('SearchFilterContainerComponent', () => {
});
it('should set/update the active filter after the Apply button is clicked', async () => {
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('#filter-menu-button');
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('[data-automation-id="filter-menu-button"]');
menuButton.click();
fixture.detectChanges();
await fixture.whenStable();
@@ -113,7 +113,7 @@ describe('SearchFilterContainerComponent', () => {
it('should remove active filter after the Clear button is clicked', async () => {
queryBuilder.setActiveFilter('name', 'searchText');
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('#filter-menu-button');
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('[data-automation-id="filter-menu-button"]');
menuButton.click();
fixture.detectChanges();
await fixture.whenStable();
@@ -133,7 +133,7 @@ describe('SearchFilterContainerComponent', () => {
component.filterChange.subscribe(() => {
eventRaised = true;
});
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('#filter-menu-button');
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('[data-automation-id="filter-menu-button"]');
menuButton.click();
fixture.detectChanges();
@@ -154,7 +154,7 @@ describe('SearchFilterContainerComponent', () => {
it('should set up a focus trap on the filter when the menu is opened', async () => {
expect(component.focusTrap).toBeUndefined();
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('#filter-menu-button');
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('[data-automation-id="filter-menu-button"]');
menuButton.click();
fixture.detectChanges();
@@ -164,7 +164,7 @@ describe('SearchFilterContainerComponent', () => {
});
it('should focus the input element when the menu is opened', async () => {
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('#filter-menu-button');
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('[data-automation-id="filter-menu-button"]');
menuButton.click();
fixture.detectChanges();
@@ -176,7 +176,7 @@ describe('SearchFilterContainerComponent', () => {
});
it('should focus the menu trigger when the menu is closed', async () => {
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('#filter-menu-button');
const menuButton: HTMLButtonElement = fixture.nativeElement.querySelector('[data-automation-id="filter-menu-button"]');
menuButton.click();
fixture.detectChanges();
@@ -188,7 +188,7 @@ describe('SearchFilterContainerComponent', () => {
fixture.detectChanges();
await fixture.whenStable();
const matMenuButton = fixture.debugElement.query(By.css('#filter-menu-button'));
const matMenuButton = fixture.debugElement.query(By.css('[data-automation-id="filter-menu-button"]'));
expect(document.activeElement).toBe(matMenuButton.nativeElement);
});
});