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 7b4705b commit 294610bCopy full SHA for 294610b
docs/dom-testing-library/api-within.mdx
@@ -37,17 +37,17 @@ const helloMessage = within(messages).getByText('hello')
37
```jsx
38
import {render, within} from '@testing-library/react'
39
40
-const {getByLabelText} = render(<MyComponent />)
41
-const signinModal = getByLabelText('Sign In')
42
-within(signinModal).getByPlaceholderText('Username')
+const {getByText} = render(<MyComponent />)
+const messages = getByText('messages')
+const helloMessage = within(messages).getByText('hello')
43
```
44
45
</TabItem>
46
<TabItem value="cypress">
47
48
```js
49
-cy.get('form').within(() => {
50
- cy.findByText('Button Text').should('be.disabled')
+cy.findByText('messages').within(() => {
+ cy.findByText('hello')
51
})
52
53
0 commit comments