From 5aa3a8059a52463cd3d36a372848b61a12fcbf6e Mon Sep 17 00:00:00 2001 From: thebinaryfelix Date: Sat, 20 Jun 2020 17:47:07 -0300 Subject: [PATCH] refactor(no-container): update error message and incorrect use case --- docs/rules/no-container.md | 2 +- lib/rules/no-container.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rules/no-container.md b/docs/rules/no-container.md index 952428fa..658879e2 100644 --- a/docs/rules/no-container.md +++ b/docs/rules/no-container.md @@ -22,7 +22,7 @@ const button = alias.querySelector('.btn-primary'); ```js const view = render(); -const button = view.container.querySelector('.btn-primary'); +const button = view.container.getElementsByClassName('.btn-primary'); ``` Examples of **correct** code for this rule: diff --git a/lib/rules/no-container.ts b/lib/rules/no-container.ts index 5f0450bc..cd7c67a9 100644 --- a/lib/rules/no-container.ts +++ b/lib/rules/no-container.ts @@ -21,7 +21,7 @@ export default ESLintUtils.RuleCreator(getDocsUrl)({ }, messages: { noContainer: - 'Avoid using container to query for elements. Prefer using query methods from Testing Library, such as "getByRole()"', + 'Avoid using container methods. Prefer using the methods from Testing Library, such as "getByRole()"', }, fixable: null, schema: [