Closed
Description
Have you read the Troubleshooting section?
Yes
Plugin version
v5.5.0
ESLint version
v8.14.0
Node.js version
v16.15.0
package manager and version
npm v8.9.0
Operating system
macOS v12.3.1
Bug description
When there is an error reported by prefer-query-by-disappearance
, it's displayed at the very beginning of the callback passed to waitForElementToBeRemoved
. Instead, the error should be placed in the query within the callback.
Steps to reproduce
it('should do something', async () => {
render(<App />)
fireEvent.click(screen.getByRole('button'))
await waitForElementToBeRemoved(() => screen.getByText('Loading'))
})
Error output/screenshots
ESLint configuration
N/A
Rule(s) affected
prefer-query-by-disappearance
Anything else?
No response
Do you want to submit a pull request to fix this bug?
No