Skip to content

Enforce async a11y assertions and scope checks to <tab-container> in tests - #121

Merged
liuliu-dev merged 2 commits into
mainfrom
copilot/fix-accessibility-test-results
Jul 28, 2026
Merged

Enforce async a11y assertions and scope checks to <tab-container> in tests#121
liuliu-dev merged 2 commits into
mainfrom
copilot/fix-accessibility-test-results

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Accessibility assertions in test/test.js were using expect(...).to.be.accessible() without awaiting/returning the async result, so axe failures could be dropped. After fixing that, body-level checks were over-broad and failed region expectations unrelated to the component under test.

  • Assertion lifecycle: make async checks observable

    • Convert relevant afterEach hooks to async and await the a11y assertion.
    • Wrap assertions in try/finally so DOM cleanup always runs.
    • Return the promise from it('has accessible markup', ...) so test runners correctly track failures.
  • Assertion scope: test the component, not page layout

    • Change accessibility checks from document.body to the fixture’s tabContainer element.
    • Ensure each affected setup initializes tabContainer before assertions.
afterEach(async function () {
  try {
    await expect(tabContainer).to.be.accessible()
  } finally {
    document.body.innerHTML = ''
  }
})

it('has accessible markup', function () {
  return expect(tabContainer).to.be.accessible()
})

Copilot AI changed the title [WIP] Fix accessibility test results handling Enforce async a11y assertions and scope checks to <tab-container> in tests Jul 27, 2026
Copilot AI requested a review from llastflowers July 27, 2026 16:46
@liuliu-dev
liuliu-dev marked this pull request as ready for review July 28, 2026 17:28
Copilot AI review requested due to automatic review settings July 28, 2026 17:28
@liuliu-dev
liuliu-dev requested a review from a team as a code owner July 28, 2026 17:28
@liuliu-dev
liuliu-dev merged commit 786d2c4 into main Jul 28, 2026
6 checks passed
@liuliu-dev
liuliu-dev deleted the copilot/fix-accessibility-test-results branch July 28, 2026 17:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Ensures accessibility checks are awaited and scoped to the component fixture.

Changes:

  • Await asynchronous accessibility assertions with guaranteed cleanup.
  • Scope axe checks to <tab-container>.
  • Initialize fixture references where required.
Show a summary per file
File Description
test/test.js Corrects accessibility assertion lifecycle and scope.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Medium

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.

Accessibility test results aren't checked

4 participants