diff --git a/docs/dom-testing-library/api-queries.md b/docs/dom-testing-library/api-queries.md index 1be322750..8c383faf3 100644 --- a/docs/dom-testing-library/api-queries.md +++ b/docs/dom-testing-library/api-queries.md @@ -131,11 +131,20 @@ cy.getByLabelText('username').should('exist') -It will NOT find the input node for label text broken up by elements. For this -case, you can provide a `selector` in the options: +You may also need to filter down the results of the query. +For that you can use the `selector` option: -```html - +```js +// Label containing multiple elements + + +// Multiple elements labelled via aria-labelledby + + +Please enter your username ``` ```js