Skip to content

chore(lint): add and apply eslint-plugin-testing-library #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

the-ult
Copy link
Contributor

@the-ult the-ult commented Apr 15, 2021

What

Add eslint-plugin-testing-library and eslint-plugin-jest-dom and fix the Errors found

Why

The examples provided should be following the standards/best practices of the testing-library.

Checklist

  • Ready to Merge

fixes #198

@the-ult
Copy link
Contributor Author

the-ult commented Apr 15, 2021

@timdeschryver
What would be the proper way to fix this?

.../angular-testing-library/apps/example-app/src/app/examples/15-dialog.component.spec.ts
57:28  error  
- Avoid direct Node access. Prefer using the methods from Testing Library  testing-library/no-node-access
  fireEvent.click(document.querySelector('.cdk-overlay-backdrop'));

https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-node-access.md

@the-ult the-ult changed the title WIP: feat/add and apply eslint-plugin-testing-library WIP: chore(lint): add and apply eslint-plugin-testing-library Apr 16, 2021
Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@the-ult You can add a disable rule comment where that error occurs.
AFAIK, there isn't an "accessible" way to click on the backdrop.
Besides that, this LGTM 👍

> there isn't an "accessible" way to click on the backdrop.
@the-ult the-ult changed the title WIP: chore(lint): add and apply eslint-plugin-testing-library chore(lint): add and apply eslint-plugin-testing-library Apr 16, 2021
@timdeschryver timdeschryver merged commit d33f0e9 into testing-library:master Apr 16, 2021
@timdeschryver
Copy link
Member

Thanks for the migration @the-ult !

@github-actions
Copy link

🎉 This PR is included in version 10.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ESLint with the eslint-plugin-testing-library and adjust examples
2 participants