From 609a7ed6dd3bace21660c9e9b5f0b0896783c38e Mon Sep 17 00:00:00 2001 From: Lorenz Hilpert Date: Wed, 10 Dec 2025 20:37:23 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BF=EF=B8=8F=20feat(shell):=20add=20E2E?= =?UTF-8?q?=20testing=20and=20ARIA=20accessibility=20attributes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add data-what/data-which attributes for E2E test targeting - Add ARIA roles (tablist, tab, group) for screen readers - Add aria-label attributes for interactive elements - Add aria-current for active tab indication --- .../shell/layout/src/lib/shell-layout.component.html | 4 ++-- .../navigation-group/navigation-group.component.html | 8 +++++++- .../src/lib/components/shell-tab-item.component.html | 12 ++++++++++-- libs/shell/tabs/src/lib/shell-tabs.component.html | 9 ++++++++- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/libs/shell/layout/src/lib/shell-layout.component.html b/libs/shell/layout/src/lib/shell-layout.component.html index 6883245ac..86c77ffed 100644 --- a/libs/shell/layout/src/lib/shell-layout.component.html +++ b/libs/shell/layout/src/lib/shell-layout.component.html @@ -2,8 +2,8 @@
diff --git a/libs/shell/navigation/src/lib/components/navigation-group/navigation-group.component.html b/libs/shell/navigation/src/lib/components/navigation-group/navigation-group.component.html index 49dda3704..92dcde4c2 100644 --- a/libs/shell/navigation/src/lib/components/navigation-group/navigation-group.component.html +++ b/libs/shell/navigation/src/lib/components/navigation-group/navigation-group.component.html @@ -1,4 +1,10 @@ -
+
diff --git a/libs/shell/tabs/src/lib/components/shell-tab-item.component.html b/libs/shell/tabs/src/lib/components/shell-tab-item.component.html index 0d094c3ae..9815fd24d 100644 --- a/libs/shell/tabs/src/lib/components/shell-tab-item.component.html +++ b/libs/shell/tabs/src/lib/components/shell-tab-item.component.html @@ -4,8 +4,10 @@ [class.compact]="compact()" [routerLink]="_route?.urlTree ?? '/'" [title]="_route?.title ?? ''" + data-what="tab-link" + [attr.data-which]="tab().id" + [attr.aria-current]="active() ? 'page' : null" > -
{{ tab().name }} @@ -16,7 +18,13 @@
- diff --git a/libs/shell/tabs/src/lib/shell-tabs.component.html b/libs/shell/tabs/src/lib/shell-tabs.component.html index 31a4de0db..fa83501ed 100644 --- a/libs/shell/tabs/src/lib/shell-tabs.component.html +++ b/libs/shell/tabs/src/lib/shell-tabs.component.html @@ -1,11 +1,12 @@ @let _tabs = tabs(); - + @for (tab of _tabs; track tab.id) { } @@ -20,6 +21,9 @@ class="self-center whitespace-nowrap" (click)="closeAll()" [class.h-6]="compact()" + data-what="button" + data-which="close-all-tabs" + aria-label="Alle Tabs schließen" > Alle schließen @@ -34,5 +38,8 @@ class="shrink-0 self-center -mt-2 z-sticky" [class.size-6]="compact()" (click)="addTab()" + data-what="button" + data-which="add-tab" + aria-label="Neuen Tab hinzufügen" > }