Skip to content

Commit 294610b

Browse files
Update api-within.mdx (testing-library#950)
1 parent 7b4705b commit 294610b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/dom-testing-library/api-within.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ const helloMessage = within(messages).getByText('hello')
3737
```jsx
3838
import {render, within} from '@testing-library/react'
3939

40-
const {getByLabelText} = render(<MyComponent />)
41-
const signinModal = getByLabelText('Sign In')
42-
within(signinModal).getByPlaceholderText('Username')
40+
const {getByText} = render(<MyComponent />)
41+
const messages = getByText('messages')
42+
const helloMessage = within(messages).getByText('hello')
4343
```
4444

4545
</TabItem>
4646
<TabItem value="cypress">
4747

4848
```js
49-
cy.get('form').within(() => {
50-
cy.findByText('Button Text').should('be.disabled')
49+
cy.findByText('messages').within(() => {
50+
cy.findByText('hello')
5151
})
5252
```
5353

0 commit comments

Comments
 (0)