From 4a9a0b1abb2b4c9923395799abd51984acb80d9a Mon Sep 17 00:00:00 2001 From: Mert Akinc <7282195+m-akinc@users.noreply.github.com> Date: Mon, 20 May 2024 18:47:34 -0500 Subject: [PATCH] Move setAttribute before connect --- packages/nimble-components/src/anchor/tests/anchor.spec.ts | 2 +- .../nimble-components/src/menu-button/tests/menu-button.spec.ts | 2 +- .../src/toggle-button/tests/toggle-button.spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nimble-components/src/anchor/tests/anchor.spec.ts b/packages/nimble-components/src/anchor/tests/anchor.spec.ts index 3813d20c39..193380572e 100644 --- a/packages/nimble-components/src/anchor/tests/anchor.spec.ts +++ b/packages/nimble-components/src/anchor/tests/anchor.spec.ts @@ -92,9 +92,9 @@ describe('Anchor', () => { }); it('should clear tabindex attribute from the internal control when cleared from the host', async () => { + element.setAttribute('tabindex', '-1'); await connect(); - element.setAttribute('tabindex', '-1'); element.removeAttribute('tabindex'); await waitForUpdatesAsync(); diff --git a/packages/nimble-components/src/menu-button/tests/menu-button.spec.ts b/packages/nimble-components/src/menu-button/tests/menu-button.spec.ts index a00a1e54e9..623b2cb122 100644 --- a/packages/nimble-components/src/menu-button/tests/menu-button.spec.ts +++ b/packages/nimble-components/src/menu-button/tests/menu-button.spec.ts @@ -136,8 +136,8 @@ describe('MenuButton', () => { it('should clear tabindex from the toggle button when cleared from the host', async () => { element.setAttribute('tabindex', '-1'); - element.removeAttribute('tabindex'); await connect(); + element.removeAttribute('tabindex'); expect(element.toggleButton!.getAttribute('tabindex')).toBeNull(); }); diff --git a/packages/nimble-components/src/toggle-button/tests/toggle-button.spec.ts b/packages/nimble-components/src/toggle-button/tests/toggle-button.spec.ts index ece727bd5e..2550b1d3e0 100644 --- a/packages/nimble-components/src/toggle-button/tests/toggle-button.spec.ts +++ b/packages/nimble-components/src/toggle-button/tests/toggle-button.spec.ts @@ -118,9 +118,9 @@ describe('ToggleButton', () => { }); it('should set the `tabindex` attribute to 0 on the internal button when removed from host', async () => { + element.setAttribute('tabindex', '-1'); await connect(); - element.setAttribute('tabindex', '-1'); element.removeAttribute('tabindex'); await waitForUpdatesAsync();