From 2dc29baf4419f1f06753c9cf14e202e5133812b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Jul 2026 16:42:49 +0000 Subject: [PATCH 1/2] Initial plan From 8e4124ba98ea83af5c39992bcbcead52ca565849 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Jul 2026 16:45:51 +0000 Subject: [PATCH 2/2] Fix async accessibility assertions in tests --- test/test.js | 63 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/test/test.js b/test/test.js index e845f4c..bd09516 100644 --- a/test/test.js +++ b/test/test.js @@ -87,19 +87,22 @@ describe('tab-container', function () { ` + tabContainer = document.querySelector('tab-container') tabs = Array.from(document.querySelectorAll('button')) panels = Array.from(document.querySelectorAll('[role="tabpanel"]')) }) - afterEach(function () { + afterEach(async function () { // Check to make sure we still have accessible markup after the test finishes running. - expect(document.body).to.be.accessible() - - document.body.innerHTML = '' + try { + await expect(tabContainer).to.be.accessible() + } finally { + document.body.innerHTML = '' + } }) it('has accessible markup', function () { - expect(document.body).to.be.accessible() + return expect(tabContainer).to.be.accessible() }) it('the second tab is still selected', function () { @@ -126,19 +129,22 @@ describe('tab-container', function () { ` + tabContainer = document.querySelector('tab-container') tabs = Array.from(document.querySelectorAll('button')) panels = Array.from(document.querySelectorAll('[role="tabpanel"]')) }) - afterEach(function () { + afterEach(async function () { // Check to make sure we still have accessible markup after the test finishes running. - expect(document.body).to.be.accessible() - - document.body.innerHTML = '' + try { + await expect(tabContainer).to.be.accessible() + } finally { + document.body.innerHTML = '' + } }) it('has accessible markup', function () { - expect(document.body).to.be.accessible() + return expect(tabContainer).to.be.accessible() }) it('the second tab is still selected', function () { @@ -175,15 +181,17 @@ describe('tab-container', function () { tabContainer.addEventListener('tab-container-changed', e => events.push(e)) }) - afterEach(function () { + afterEach(async function () { // Check to make sure we still have accessible markup after the test finishes running. - expect(document.body).to.be.accessible() - - document.body.innerHTML = '' + try { + await expect(tabContainer).to.be.accessible() + } finally { + document.body.innerHTML = '' + } }) it('has accessible markup', function () { - expect(document.body).to.be.accessible() + return expect(tabContainer).to.be.accessible() }) it('click works and `tab-container-changed` event is dispatched with correct index', function () { @@ -404,15 +412,17 @@ describe('tab-container', function () { tabContainer.addEventListener('tab-container-changed', e => events.push(e)) }) - afterEach(function () { + afterEach(async function () { // Check to make sure we still have accessible markup after the test finishes running. - expect(document.body).to.be.accessible() - - document.body.innerHTML = '' + try { + await expect(tabContainer).to.be.accessible() + } finally { + document.body.innerHTML = '' + } }) it('has accessible markup', function () { - expect(document.body).to.be.accessible() + return expect(tabContainer).to.be.accessible() }) it('only switches closest tab-containers on click', () => { @@ -710,19 +720,22 @@ describe('tab-container', function () { ` + tabContainer = document.querySelector('tab-container') tabs = Array.from(document.querySelectorAll('button')) panels = Array.from(document.querySelectorAll('[role="tabpanel"]')) }) - afterEach(function () { + afterEach(async function () { // Check to make sure we still have accessible markup after the test finishes running. - expect(document.body).to.be.accessible() - - document.body.innerHTML = '' + try { + await expect(tabContainer).to.be.accessible() + } finally { + document.body.innerHTML = '' + } }) it('has accessible markup', function () { - expect(document.body).to.be.accessible() + return expect(tabContainer).to.be.accessible() }) it('the second tab is still selected', function () {