Closed
Description
Plugin version
v5.0.0
ESLint version
v8.2.0
Node.js version
14.18.0
npm/yarn version
1.22.17
Operating system
Big Sur
Bug description
Generally I like this rule but we have to disable it in quite a few places due to false positives with toBeNull.
Steps to reproduce
Examples:
expect(queryTooltip(screen.getByText('Some text'))).toBeNull();
expect(within(screen.getByRole('dialog')).queryByText('Some text')).toBeNull();
expect(screen.getByText('Some text').getAttribute('disabled')).toBeNull();
Error output/screenshots
No response
ESLint configuration
{
files: ['src/**/*.test.[tj]s?(x)', 'src/test/**/*.[tj]s?(x)'],
env: {
jest: true,
browser: true,
},
plugins: ['eslint-plugin-jest', 'eslint-plugin-testing-library'],
extends: ['plugin:jest/recommended', 'plugin:testing-library/react'],
rules: {
// warning are under migration
'testing-library/prefer-screen-queries': 'warn',
'testing-library/no-render-in-setup': 'warn',
'testing-library/render-result-naming-convention': 'warn',
'testing-library/no-wait-for-multiple-assertions': 'warn',
'testing-library/no-node-access': 'off'
},
},
Rule(s) affected
testing-library/prefer-presence-queries
Anything else?
No response
Do you want to submit a pull request to fix this bug?
No