diff --git a/docs/dom-testing-library/api-queries.md b/docs/dom-testing-library/api-queries.md index 6aa4da0cd..024565a6f 100644 --- a/docs/dom-testing-library/api-queries.md +++ b/docs/dom-testing-library/api-queries.md @@ -308,7 +308,7 @@ as it's deprecated). import { getByAltText } from 'dom-testing-library' const container = document.body -const incrediblesPosterImg = getByAltText(container, /incredibles.*png$/i) +const incrediblesPosterImg = getByAltText(container, /incredibles.*? poster/i) ``` @@ -317,13 +317,13 @@ const incrediblesPosterImg = getByAltText(container, /incredibles.*png$/i) import { render } from 'react-testing-library' const { getByAltText } = render() -const incrediblesPosterImg = getByAltText(/incredibles.*png$/i) +const incrediblesPosterImg = getByAltText(/incredibles.*? poster/i) ``` ```js -cy.getByAltText(/incredibles.*png$/i).should('exist') +cy.getByAltText(/incredibles.*? poster/i).should('exist') ```