From fb593335f4cb874110268ba4d3526711dc7e7061 Mon Sep 17 00:00:00 2001 From: StyleShit <32631382+StyleShit@users.noreply.github.com> Date: Sun, 11 May 2025 10:26:49 +0300 Subject: [PATCH 1/6] feat: add `no-test-id-queries` rule Closes #279 --- README.md | 1 + docs/rules/no-test-id-queries.md | 31 +++++++++ lib/configs/angular.ts | 1 + lib/configs/dom.ts | 1 + lib/configs/marko.ts | 1 + lib/configs/react.ts | 1 + lib/configs/svelte.ts | 1 + lib/configs/vue.ts | 1 + lib/rules/no-test-id-queries.ts | 46 +++++++++++++ tests/lib/rules/no-test-id-queries.test.ts | 78 ++++++++++++++++++++++ 10 files changed, 162 insertions(+) create mode 100644 docs/rules/no-test-id-queries.md create mode 100644 lib/rules/no-test-id-queries.ts create mode 100644 tests/lib/rules/no-test-id-queries.test.ts diff --git a/README.md b/README.md index ad167abf..197d055d 100644 --- a/README.md +++ b/README.md @@ -338,6 +338,7 @@ module.exports = [ | [no-node-access](docs/rules/no-node-access.md) | Disallow direct Node access | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-promise-in-fire-event](docs/rules/no-promise-in-fire-event.md) | Disallow the use of promises passed to a `fireEvent` method | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-render-in-lifecycle](docs/rules/no-render-in-lifecycle.md) | Disallow the use of `render` in testing frameworks setup functions | ![badge-angular][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | +| [no-test-id-queries](docs/rules/no-test-id-queries.md) | Ensure no `data-testid` queries are used | | | | | [no-unnecessary-act](docs/rules/no-unnecessary-act.md) | Disallow wrapping Testing Library utils or empty callbacks in `act` | ![badge-marko][] ![badge-react][] | | | | [no-wait-for-multiple-assertions](docs/rules/no-wait-for-multiple-assertions.md) | Disallow the use of multiple `expect` calls inside `waitFor` | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-wait-for-side-effects](docs/rules/no-wait-for-side-effects.md) | Disallow the use of side effects in `waitFor` | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | diff --git a/docs/rules/no-test-id-queries.md b/docs/rules/no-test-id-queries.md new file mode 100644 index 00000000..70c5614e --- /dev/null +++ b/docs/rules/no-test-id-queries.md @@ -0,0 +1,31 @@ +# Ensure no `data-testid` queries are used (`testing-library/no-test-id-queries`) + + + +## Rule Details + +This rule aims to reduce the usage of `*ByTestId` queries in your tests. + +When using `*ByTestId` queries, you are coupling your tests to the implementation details of your components, and not to how they behave and being used. + +Prefer using queries that are more related to the user experience, like `getByRole`, `getByLabelText`, etc. + +Example of **incorrect** code for this rule: + +```js +const button = queryByTestId('my-button'); +const input = screen.queryByTestId('my-input'); +``` + +Examples of **correct** code for this rule: + +```js +const button = screen.getByRole('button'); +const input = screen.getByRole('textbox'); +``` + +## Further Reading + +- [about `getByTestId`](https://testing-library.com/docs/queries/bytestid) +- [about `getByRole`](https://testing-library.com/docs/queries/byrole) +- [about `getByLabelText`](https://testing-library.com/docs/queries/bylabeltext) diff --git a/lib/configs/angular.ts b/lib/configs/angular.ts index ef0fcc22..c96ba62a 100644 --- a/lib/configs/angular.ts +++ b/lib/configs/angular.ts @@ -23,6 +23,7 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', + 'testing-library/no-test-id-queries': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', 'testing-library/no-wait-for-snapshot': 'error', diff --git a/lib/configs/dom.ts b/lib/configs/dom.ts index 98e8cfeb..d1d45685 100644 --- a/lib/configs/dom.ts +++ b/lib/configs/dom.ts @@ -19,6 +19,7 @@ export = { 'testing-library/no-global-regexp-flag-in-query': 'error', 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', + 'testing-library/no-test-id-queries': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', 'testing-library/no-wait-for-snapshot': 'error', diff --git a/lib/configs/marko.ts b/lib/configs/marko.ts index 1301d135..55d68ac9 100644 --- a/lib/configs/marko.ts +++ b/lib/configs/marko.ts @@ -19,6 +19,7 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', + 'testing-library/no-test-id-queries': 'error', 'testing-library/no-unnecessary-act': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', diff --git a/lib/configs/react.ts b/lib/configs/react.ts index c1e293b3..15a0bae5 100644 --- a/lib/configs/react.ts +++ b/lib/configs/react.ts @@ -24,6 +24,7 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', + 'testing-library/no-test-id-queries': 'error', 'testing-library/no-unnecessary-act': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', diff --git a/lib/configs/svelte.ts b/lib/configs/svelte.ts index 7713f9db..9bd1c8c9 100644 --- a/lib/configs/svelte.ts +++ b/lib/configs/svelte.ts @@ -20,6 +20,7 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', + 'testing-library/no-test-id-queries': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', 'testing-library/no-wait-for-snapshot': 'error', diff --git a/lib/configs/vue.ts b/lib/configs/vue.ts index f7fd1487..71f1bff1 100644 --- a/lib/configs/vue.ts +++ b/lib/configs/vue.ts @@ -20,6 +20,7 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', + 'testing-library/no-test-id-queries': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', 'testing-library/no-wait-for-snapshot': 'error', diff --git a/lib/rules/no-test-id-queries.ts b/lib/rules/no-test-id-queries.ts new file mode 100644 index 00000000..be84d3ff --- /dev/null +++ b/lib/rules/no-test-id-queries.ts @@ -0,0 +1,46 @@ +import { TSESTree } from '@typescript-eslint/utils'; + +import { createTestingLibraryRule } from '../create-testing-library-rule'; + +export const RULE_NAME = 'no-test-id-queries'; +export type MessageIds = 'noTestIdQueries'; +type Options = []; + +const QUERIES_REGEX = /^(get|query|getAll|queryAll|find|findAll)ByTestId$/; + +export default createTestingLibraryRule({ + name: RULE_NAME, + meta: { + type: 'problem', + docs: { + description: 'Ensure no `data-testid` queries are used', + recommendedConfig: { + dom: 'error', + angular: 'error', + react: 'error', + vue: 'error', + svelte: 'error', + marko: 'error', + }, + }, + messages: { + noTestIdQueries: + 'Using `data-testid` queries is not recommended. Use a more descriptive query instead.', + }, + schema: [], + }, + defaultOptions: [], + + create(context) { + return { + [`CallExpression[callee.property.name=${String(QUERIES_REGEX)}], CallExpression[callee.name=${String(QUERIES_REGEX)}]`]( + node: TSESTree.CallExpression + ) { + context.report({ + node, + messageId: 'noTestIdQueries', + }); + }, + }; + }, +}); diff --git a/tests/lib/rules/no-test-id-queries.test.ts b/tests/lib/rules/no-test-id-queries.test.ts new file mode 100644 index 00000000..5135ced5 --- /dev/null +++ b/tests/lib/rules/no-test-id-queries.test.ts @@ -0,0 +1,78 @@ +import rule, { RULE_NAME } from '../../../lib/rules/no-test-id-queries'; +import { createRuleTester } from '../test-utils'; + +const ruleTester = createRuleTester(); + +const SUPPORTED_TESTING_FRAMEWORKS = [ + '@testing-library/dom', + '@testing-library/angular', + '@testing-library/react', + '@testing-library/vue', + '@marko/testing-library', +]; + +const QUERIES = [ + 'getByTestId', + 'queryByTestId', + 'getAllByTestId', + 'queryAllByTestId', + 'findByTestId', + 'findAllByTestId', +]; + +ruleTester.run(RULE_NAME, rule, { + valid: [ + { + code: ` + import { render } from '@testing-library/react'; + + test('test', async () => { + const { getByRole } = render(); + + expect(getByRole('button')).toBeInTheDocument(); + }); + `, + }, + ], + + invalid: SUPPORTED_TESTING_FRAMEWORKS.flatMap((framework) => + QUERIES.flatMap((query) => [ + { + code: ` + import { render } from '${framework}'; + + test('test', async () => { + const { ${query} } = render(); + + expect(${query}('my-test-id')).toBeInTheDocument(); + }); + `, + errors: [ + { + messageId: 'noTestIdQueries', + line: 7, + column: 14, + }, + ], + }, + { + code: ` + import { render, screen } from '${framework}'; + + test('test', async () => { + render(); + + expect(screen.${query}('my-test-id')).toBeInTheDocument(); + }); + `, + errors: [ + { + messageId: 'noTestIdQueries', + line: 7, + column: 14, + }, + ], + }, + ]) + ), +}); From 45c70c2f48ae8bbe135769babaf57c67c5f208c7 Mon Sep 17 00:00:00 2001 From: StyleShit <32631382+StyleShit@users.noreply.github.com> Date: Mon, 12 May 2025 09:05:16 +0300 Subject: [PATCH 2/6] test: fix tests --- tests/index.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/index.test.ts b/tests/index.test.ts index 0695abde..03cdbe2b 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -3,7 +3,7 @@ import { resolve } from 'path'; import plugin from '../lib'; -const numberOfRules = 27; +const numberOfRules = 28; const ruleNames = Object.keys(plugin.rules); // eslint-disable-next-line jest/expect-expect From dc2373301e76588f02d099b2ae9c51ed95390c73 Mon Sep 17 00:00:00 2001 From: StyleShit <32631382+StyleShit@users.noreply.github.com> Date: Mon, 12 May 2025 11:08:45 +0300 Subject: [PATCH 3/6] fix: cr changes --- docs/rules/no-test-id-queries.md | 1 + lib/rules/no-test-id-queries.ts | 5 +++-- tests/lib/rules/no-test-id-queries.test.ts | 26 ++++++++++++++-------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/docs/rules/no-test-id-queries.md b/docs/rules/no-test-id-queries.md index 70c5614e..958b6bf7 100644 --- a/docs/rules/no-test-id-queries.md +++ b/docs/rules/no-test-id-queries.md @@ -29,3 +29,4 @@ const input = screen.getByRole('textbox'); - [about `getByTestId`](https://testing-library.com/docs/queries/bytestid) - [about `getByRole`](https://testing-library.com/docs/queries/byrole) - [about `getByLabelText`](https://testing-library.com/docs/queries/bylabeltext) +- [Common mistakes with React Testing Library - Not querying by text](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-querying-by-text) diff --git a/lib/rules/no-test-id-queries.ts b/lib/rules/no-test-id-queries.ts index be84d3ff..023997ec 100644 --- a/lib/rules/no-test-id-queries.ts +++ b/lib/rules/no-test-id-queries.ts @@ -1,12 +1,13 @@ import { TSESTree } from '@typescript-eslint/utils'; import { createTestingLibraryRule } from '../create-testing-library-rule'; +import { ALL_QUERIES_VARIANTS } from '../utils'; export const RULE_NAME = 'no-test-id-queries'; export type MessageIds = 'noTestIdQueries'; type Options = []; -const QUERIES_REGEX = /^(get|query|getAll|queryAll|find|findAll)ByTestId$/; +const QUERIES_REGEX = `/^(${ALL_QUERIES_VARIANTS.join('|')})TestId$/`; export default createTestingLibraryRule({ name: RULE_NAME, @@ -33,7 +34,7 @@ export default createTestingLibraryRule({ create(context) { return { - [`CallExpression[callee.property.name=${String(QUERIES_REGEX)}], CallExpression[callee.name=${String(QUERIES_REGEX)}]`]( + [`CallExpression[callee.property.name=${QUERIES_REGEX}], CallExpression[callee.name=${QUERIES_REGEX}]`]( node: TSESTree.CallExpression ) { context.report({ diff --git a/tests/lib/rules/no-test-id-queries.test.ts b/tests/lib/rules/no-test-id-queries.test.ts index 5135ced5..23ba3335 100644 --- a/tests/lib/rules/no-test-id-queries.test.ts +++ b/tests/lib/rules/no-test-id-queries.test.ts @@ -22,17 +22,25 @@ const QUERIES = [ ruleTester.run(RULE_NAME, rule, { valid: [ - { - code: ` - import { render } from '@testing-library/react'; + ` + import { render } from '@testing-library/react'; - test('test', async () => { - const { getByRole } = render(); + test('test', async () => { + const { getByRole } = render(); - expect(getByRole('button')).toBeInTheDocument(); - }); - `, - }, + expect(getByRole('button')).toBeInTheDocument(); + }); + `, + + ` + import { render } from '@testing-library/react'; + + test('test', async () => { + render(); + + expect(getTestId('button')).toBeInTheDocument(); + }); + `, ], invalid: SUPPORTED_TESTING_FRAMEWORKS.flatMap((framework) => From 50c44c6aebd59f38d33585aee1cfafe00a21ba6a Mon Sep 17 00:00:00 2001 From: StyleShit <32631382+StyleShit@users.noreply.github.com> Date: Mon, 12 May 2025 11:10:35 +0300 Subject: [PATCH 4/6] docs: generate --- README.md | 2 +- docs/rules/no-test-id-queries.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 197d055d..e254155f 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,7 @@ module.exports = [ | [no-node-access](docs/rules/no-node-access.md) | Disallow direct Node access | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-promise-in-fire-event](docs/rules/no-promise-in-fire-event.md) | Disallow the use of promises passed to a `fireEvent` method | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-render-in-lifecycle](docs/rules/no-render-in-lifecycle.md) | Disallow the use of `render` in testing frameworks setup functions | ![badge-angular][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | -| [no-test-id-queries](docs/rules/no-test-id-queries.md) | Ensure no `data-testid` queries are used | | | | +| [no-test-id-queries](docs/rules/no-test-id-queries.md) | Ensure no `data-testid` queries are used | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-unnecessary-act](docs/rules/no-unnecessary-act.md) | Disallow wrapping Testing Library utils or empty callbacks in `act` | ![badge-marko][] ![badge-react][] | | | | [no-wait-for-multiple-assertions](docs/rules/no-wait-for-multiple-assertions.md) | Disallow the use of multiple `expect` calls inside `waitFor` | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-wait-for-side-effects](docs/rules/no-wait-for-side-effects.md) | Disallow the use of side effects in `waitFor` | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | diff --git a/docs/rules/no-test-id-queries.md b/docs/rules/no-test-id-queries.md index 958b6bf7..4fbe2acc 100644 --- a/docs/rules/no-test-id-queries.md +++ b/docs/rules/no-test-id-queries.md @@ -1,5 +1,7 @@ # Ensure no `data-testid` queries are used (`testing-library/no-test-id-queries`) +💼 This rule is enabled in the following configs: `angular`, `dom`, `marko`, `react`, `svelte`, `vue`. + ## Rule Details From 4090c56354117485aead5a743a502afa706b7d76 Mon Sep 17 00:00:00 2001 From: StyleShit <32631382+StyleShit@users.noreply.github.com> Date: Mon, 12 May 2025 16:45:43 +0300 Subject: [PATCH 5/6] fix: remove from recommended config --- lib/configs/angular.ts | 1 - lib/configs/dom.ts | 1 - lib/configs/marko.ts | 1 - lib/configs/react.ts | 1 - lib/configs/svelte.ts | 1 - lib/configs/vue.ts | 1 - lib/rules/no-test-id-queries.ts | 12 ++++++------ 7 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/configs/angular.ts b/lib/configs/angular.ts index c96ba62a..ef0fcc22 100644 --- a/lib/configs/angular.ts +++ b/lib/configs/angular.ts @@ -23,7 +23,6 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', - 'testing-library/no-test-id-queries': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', 'testing-library/no-wait-for-snapshot': 'error', diff --git a/lib/configs/dom.ts b/lib/configs/dom.ts index d1d45685..98e8cfeb 100644 --- a/lib/configs/dom.ts +++ b/lib/configs/dom.ts @@ -19,7 +19,6 @@ export = { 'testing-library/no-global-regexp-flag-in-query': 'error', 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', - 'testing-library/no-test-id-queries': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', 'testing-library/no-wait-for-snapshot': 'error', diff --git a/lib/configs/marko.ts b/lib/configs/marko.ts index 55d68ac9..1301d135 100644 --- a/lib/configs/marko.ts +++ b/lib/configs/marko.ts @@ -19,7 +19,6 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', - 'testing-library/no-test-id-queries': 'error', 'testing-library/no-unnecessary-act': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', diff --git a/lib/configs/react.ts b/lib/configs/react.ts index 15a0bae5..c1e293b3 100644 --- a/lib/configs/react.ts +++ b/lib/configs/react.ts @@ -24,7 +24,6 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', - 'testing-library/no-test-id-queries': 'error', 'testing-library/no-unnecessary-act': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', diff --git a/lib/configs/svelte.ts b/lib/configs/svelte.ts index 9bd1c8c9..7713f9db 100644 --- a/lib/configs/svelte.ts +++ b/lib/configs/svelte.ts @@ -20,7 +20,6 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', - 'testing-library/no-test-id-queries': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', 'testing-library/no-wait-for-snapshot': 'error', diff --git a/lib/configs/vue.ts b/lib/configs/vue.ts index 71f1bff1..f7fd1487 100644 --- a/lib/configs/vue.ts +++ b/lib/configs/vue.ts @@ -20,7 +20,6 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-render-in-lifecycle': 'error', - 'testing-library/no-test-id-queries': 'error', 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/no-wait-for-side-effects': 'error', 'testing-library/no-wait-for-snapshot': 'error', diff --git a/lib/rules/no-test-id-queries.ts b/lib/rules/no-test-id-queries.ts index 023997ec..7420f8d8 100644 --- a/lib/rules/no-test-id-queries.ts +++ b/lib/rules/no-test-id-queries.ts @@ -16,12 +16,12 @@ export default createTestingLibraryRule({ docs: { description: 'Ensure no `data-testid` queries are used', recommendedConfig: { - dom: 'error', - angular: 'error', - react: 'error', - vue: 'error', - svelte: 'error', - marko: 'error', + dom: false, + angular: false, + react: false, + vue: false, + svelte: false, + marko: false, }, }, messages: { From 6ce243a19b1f849c976bb31a1d648d3260ad4507 Mon Sep 17 00:00:00 2001 From: StyleShit <32631382+StyleShit@users.noreply.github.com> Date: Mon, 12 May 2025 16:56:39 +0300 Subject: [PATCH 6/6] docs: remove from recommended configs --- README.md | 2 +- docs/rules/no-test-id-queries.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index e254155f..197d055d 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,7 @@ module.exports = [ | [no-node-access](docs/rules/no-node-access.md) | Disallow direct Node access | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-promise-in-fire-event](docs/rules/no-promise-in-fire-event.md) | Disallow the use of promises passed to a `fireEvent` method | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-render-in-lifecycle](docs/rules/no-render-in-lifecycle.md) | Disallow the use of `render` in testing frameworks setup functions | ![badge-angular][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | -| [no-test-id-queries](docs/rules/no-test-id-queries.md) | Ensure no `data-testid` queries are used | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | +| [no-test-id-queries](docs/rules/no-test-id-queries.md) | Ensure no `data-testid` queries are used | | | | | [no-unnecessary-act](docs/rules/no-unnecessary-act.md) | Disallow wrapping Testing Library utils or empty callbacks in `act` | ![badge-marko][] ![badge-react][] | | | | [no-wait-for-multiple-assertions](docs/rules/no-wait-for-multiple-assertions.md) | Disallow the use of multiple `expect` calls inside `waitFor` | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | | [no-wait-for-side-effects](docs/rules/no-wait-for-side-effects.md) | Disallow the use of side effects in `waitFor` | ![badge-angular][] ![badge-dom][] ![badge-marko][] ![badge-react][] ![badge-svelte][] ![badge-vue][] | | | diff --git a/docs/rules/no-test-id-queries.md b/docs/rules/no-test-id-queries.md index 4fbe2acc..958b6bf7 100644 --- a/docs/rules/no-test-id-queries.md +++ b/docs/rules/no-test-id-queries.md @@ -1,7 +1,5 @@ # Ensure no `data-testid` queries are used (`testing-library/no-test-id-queries`) -💼 This rule is enabled in the following configs: `angular`, `dom`, `marko`, `react`, `svelte`, `vue`. - ## Rule Details