We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f27d14c commit 8df69f3Copy full SHA for 8df69f3
types/__tests__/type-tests.ts
@@ -10,6 +10,7 @@ import {
10
waitForElementToBeRemoved,
11
MatcherOptions,
12
BoundFunctions,
13
+ within,
14
} from '@testing-library/dom'
15
16
const {
@@ -228,6 +229,18 @@ export async function testWaitFors() {
228
229
await waitFor(async () => {})
230
}
231
232
+export async function testWithin() {
233
+ const sut = within(document.body)
234
+ sut.queryAllByLabelText('Some label')
235
+
236
+ sut.getByText('Click me')
237
+ sut.getByText<HTMLButtonElement>('Click me')
238
+ sut.getAllByText<HTMLButtonElement>('Click me')
239
240
+ await sut.findByRole('button', {name: /click me/i})
241
+ sut.getByRole<HTMLButtonElement>('button', {name: /click me/i})
242
+}
243
244
/*
245
eslint
246
@typescript-eslint/no-unnecessary-condition: "off",
0 commit comments