diff --git a/types/testing-library__dom/role-helpers.d.ts b/types/testing-library__dom/role-helpers.d.ts index 8fb422d90b..37abddd828 100644 --- a/types/testing-library__dom/role-helpers.d.ts +++ b/types/testing-library__dom/role-helpers.d.ts @@ -1,2 +1,7 @@ export function logRoles(container: HTMLElement): string; export function getRoles(container: HTMLElement): { [index: string]: HTMLElement[] }; +/** + * https://testing-library.com/docs/dom-testing-library/api-helpers#isinaccessible + * @param element + */ +export function isInaccessible(element: Element): boolean; diff --git a/types/testing-library__dom/testing-library__dom-tests.ts b/types/testing-library__dom/testing-library__dom-tests.ts index 072ea21366..e6b74755b8 100644 --- a/types/testing-library__dom/testing-library__dom-tests.ts +++ b/types/testing-library__dom/testing-library__dom-tests.ts @@ -1,4 +1,4 @@ -import { queries } from '@testing-library/dom'; +import { queries, isInaccessible } from '@testing-library/dom'; const { getByText, queryByText, findByText, getAllByText, queryAllByText, findAllByText, queryByRole } = queries; @@ -19,3 +19,8 @@ function testByRole() { console.assert(queryByRole(element, 'button') === null); console.assert(queryByRole(element, 'button', { hidden: true }) !== null); } + +function testA11yHelper() { + const element = document.createElement('svg'); + console.assert(!isInaccessible(element)); +}