Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

test(Typeahead): the disabled-field contract checks the native disabled attribute, not toBeDisabled (#9315)

Cindy Zhange6bc6e3a14fb
diff --git a/packages/core/src/Typeahead/Typeahead.disabled.a11y.chromium.spec.ts b/packages/core/src/Typeahead/Typeahead.disabled.a11y.chromium.spec.ts
index caf0b6dcfb..fa6cd0cb05 100644
--- a/packages/core/src/Typeahead/Typeahead.disabled.a11y.chromium.spec.ts
+++ b/packages/core/src/Typeahead/Typeahead.disabled.a11y.chromium.spec.ts
@@ -33,7 +33,10 @@ for (const story of ['core-typeahead--disabled', 'core-tokenizer--disabled']) {
);
const input = page.getByRole('combobox');
await input.waitFor();
- await expect(input).not.toBeDisabled();
+ // Disabled through aria-disabled, not the native attribute, so it keeps
+ // its tab stop. Playwright's toBeDisabled counts aria-disabled too, so
+ // the native attribute is checked directly.
+ await expect(input).not.toHaveAttribute('disabled');
await expect(input).toHaveAttribute('aria-disabled', 'true');
await page.keyboard.press('Tab');