MENDELU/Fixed integration tests#1294
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates several search result list-element templates to improve accessibility (and likely address related integration/a11y assertions) by providing an accessible name for thumbnail-only links.
Changes:
- Added
aria-labelto thumbnail<a>links usingdsoNameService.getName(dso)across multiple item/entity list elements. - Kept existing link behavior (
target,rel,routerLink,tabindex) unchanged while improving screen-reader support.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html | Adds aria-label to the thumbnail link for item search result list elements. |
| src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.html | Adds aria-label to the thumbnail link for project search result list elements. |
| src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html | Adds aria-label to the thumbnail link for journal search result list elements. |
| src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html | Adds aria-label to the thumbnail link for journal volume search result list elements. |
| src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html | Adds aria-label to the thumbnail link for journal issue search result list elements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ull item-page render MetadataLinkService is a singleton (providedIn: root) that fetches 5 backend configuration properties in parallel via combineLatest. The template on the full item page subscribes to it via async pipes inside an @for loop over metadata entries; subscriber count fluctuates as rows render, and with shareReplay({ refCount: true }) the inner subscription was torn down and re-created repeatedly, causing the 5 HTTP calls to repeat and the metadata table to render slowly or inconsistently on Cypress CI runners. - Switch shareReplay to refCount: false so resolver values are cached for the lifetime of the service. - Eagerly subscribe in the constructor so the fetches start as soon as the service is created (during the first FullItemPageComponent instantiation), warming the replay buffer before template subscriptions run.
…ilize /full item-page render" This reverts commit 3b852c4.
…it for inner content before axe checks - edit-item-page tablist had disabled <button> children without role=tab; when all tabs start with enabled|async = false the <ul role=tablist> momentarily has no role=tab children, triggering aria-required-children. Add role=tab + aria-disabled=true + aria-selected=false + tabindex=-1 to the disabled button so the tablist always has valid children. - For 4 axe checks that failed with 'No elements found for include in page Context' on CI runners (collection delete, community delete, item-edit status, item /full), wait for a stable inner element to render before calling testA11y; the host element passes :visible due to its padding/header even when its main content hasn't streamed in yet.
…olver config permanently Previous push reduced failures from 5 to 3 tests; remaining 3 all fail with 'No elements found for include in page Context': /full (despite 30s wait for .item-page + ds-item-page-title-field that PASSED), item-edit Bitstreams tab, community-edit Assign Roles tab. 1) testA11y(): when include is a CSS string, wait up to 30s for any child to exist on the host before running axe. Eliminates host-without-content races uniformly across every axe-checked spec. 2) MetadataLinkService: shareReplay refCount true -> false, plus eager subscribe in constructor. Service is providedIn root with combineLatest of 5 backend configuration HTTP calls. On /full item page, async pipes inside @for over metadata rows churn subscribers; with refCount true each churn tears down the inner subscription and re-fetches all 5 properties, causing the template to repeatedly re-evaluate and produce empty intermediate render states (visible as blank main content in the CI failure screenshot). Caching for the service lifetime stabilises the render.
… avoid 'No elements found' race After previous push, CI improved 3->3 failures but the remaining 3 (community Delete, item-edit Curate, /full) all still fail with 'No elements found for include in page Context'. Root cause: cypress-axe forwards the string selector context to axe.run, which re-resolves it via document.querySelectorAll at axe.run time. Between Cypress commands (injectAxe reads the axe-core source file, configureAxe evals window.axe.configure) several ms elapse; Angular can re-render and remove the host element from the document for one microtask, making the selector resolve to zero elements. Fix: in testA11y, after waiting for the host with rendered descendants, resolve the selector ourselves and pass the live DOM Element reference (not the selector string) to cy.checkA11y. axe-core uses the Element directly and skips selector resolution, eliminating the race.
Addresses Copilot review on PR #1294: when selector matches multiple elements, scanning only \[0] reduced coverage. Use \.toArray() so axe sees all matches like the original string-context did.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix Cypress accessibility failures on customer/mendelu by adding accessible names to thumbnail-only links.
Root Cause
Some search-result list templates rendered
<a>around only<ds-thumbnail>with no discernible text/label, triggering axelink-nameviolations.Change
Added:
[attr.aria-label]="dsoNameService.getName(dso)"Updated templates:
Impact
Sync verification
If en.json5 or cs.json5 translation files were updated:
yarn run sync-i18n -t src/assets/i18n/cs.json5 -ito synchronize messages, and changes are included in this PR.Manual Testing (if applicable)
Copilot review