Skip to content

test: support with-aria-* attributes on testutils-element - #5137

Merged
straker merged 1 commit into
developfrom
testutils-internals-attrs
Jun 9, 2026
Merged

test: support with-aria-* attributes on testutils-element#5137
straker merged 1 commit into
developfrom
testutils-internals-attrs

Conversation

@straker

@straker straker commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

In preparation for #5044, this will allow us to declaratively set aria prop values on the testutils-element using with-aria-* attributes (mimicking the with-role attribute). It handles converting idref(s) attributes to their DOM nodes.

@straker
straker requested a review from a team as a code owner June 8, 2026 17:39

@chutchins25 chutchins25 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — clean implementation that mirrors the existing with-role pattern, and reading the attributes in the constructor works fine for the innerHTML/queryFixture usage since the element upgrades after its attributes are appended. Nice prep for #5044.

One thing worth keeping in mind for later (not blocking): the singular-vs-array branch keys off type, so it covers the attributes #5044 needs but not aria-details/aria-errormessage, which are type: 'idref' in the standards data yet reflect to the plural *Elements array props. If those come into scope, deriving arity from the prop suffix (Elements → array) would handle them uniformly.

This is what Claude kept reporting during my review. I feel like we have had discussions about this on and off the last several days. Will defer to you on what, if anything, we should change about it.

@straker

straker commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

aria-details/aria-errormessage being idref in standards kinda a "bug" (but not really). They should be updated to idrefs as of WAI-ARIA 1.3, especially since their AOM properties are plural. I don't think that will cause us any issues for now though, and not for this pr.

@straker
straker merged commit 81853d9 into develop Jun 9, 2026
23 checks passed
@straker
straker deleted the testutils-internals-attrs branch June 9, 2026 17:41
pull Bot pushed a commit to Oleksandr-prog/axe-core that referenced this pull request Jun 10, 2026
…5137)

In preparation for dequelabs#5044,
this will allow us to declaratively set aria prop values on the
`testutils-element` using `with-aria-*` attributes (mimicking the
`with-role` attribute). It handles converting idref(s) attributes to
their DOM nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants