Skip to content

Commit 5aa3a80

Browse files
refactor(no-container): update error message
and incorrect use case
1 parent e63968f commit 5aa3a80

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/rules/no-container.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const button = alias.querySelector('.btn-primary');
2222

2323
```js
2424
const view = render(<Example />);
25-
const button = view.container.querySelector('.btn-primary');
25+
const button = view.container.getElementsByClassName('.btn-primary');
2626
```
2727

2828
Examples of **correct** code for this rule:

lib/rules/no-container.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default ESLintUtils.RuleCreator(getDocsUrl)({
2121
},
2222
messages: {
2323
noContainer:
24-
'Avoid using container to query for elements. Prefer using query methods from Testing Library, such as "getByRole()"',
24+
'Avoid using container methods. Prefer using the methods from Testing Library, such as "getByRole()"',
2525
},
2626
fixable: null,
2727
schema: [

0 commit comments

Comments
 (0)