Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 5aef5b8

Browse files
committed
docs(readme): update scoping example in fixture section with correct usage
Closes #411
1 parent a16a5b2 commit 5aef5b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ yarn add --dev @playwright-testing-library/test
5858

5959
```ts
6060
import {test as baseTest} from '@playwright/test'
61-
import {fixtures, TestingLibraryFixtures} from '@playwright-testing-library/test/fixture'
61+
import {fixtures, within, TestingLibraryFixtures} from '@playwright-testing-library/test/fixture'
6262

6363
// As only fixture
6464
const test = baseTest.extend<TestingLibraryFixtures>(fixtures)
@@ -79,8 +79,8 @@ const {expect} = test
7979
test('my form', async ({queries: {getByTestId}}) => {
8080
const $form = await getByTestId('my-form')
8181

82-
// Scope queries with `getQueriesForElement`
83-
const {getByLabelText} = $form.getQueriesForElement()
82+
// Scope queries with `within`
83+
const {getByLabelText} = within($form)
8484

8585
const $email = await getByLabelText('Email')
8686

0 commit comments

Comments
 (0)