Skip to content

Some suggestions for examples #161

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

Closed
rafaelss95 opened this issue Nov 5, 2020 · 2 comments
Closed

Some suggestions for examples #161

rafaelss95 opened this issue Nov 5, 2020 · 2 comments

Comments

@rafaelss95
Copy link
Contributor

  • Replace fireEvent.blur(htmlElement) by htmlElement.blur() (https://testing-library.com/docs/guide-events/#focusblur);
  • Replace findBy*/getBy*/queryBy* by screen.*;
  • Add more examples in forms (mainly in material version):
    • Tests using mat-error for each form-field instead of a block of errors;
    • Tests with form-friendly components, like checkbox, datepicker, chips, slider, button-toggle, autocomplete.

Note that if you like the idea, I can submit a PR ASAP.

@timdeschryver
Copy link
Member

Thanks for the suggestions, we would love to have these!
Also, TIL for the blur. I do think we'll have to test it out for ATL, since this wouldn't trigger a change detection AFAIK.

@timdeschryver
Copy link
Member

Closing this issue because it's been inactive.
To test forms, you can take a look at A practical guide to Angular Template-Driven Forms, which has some tests in the examples.

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

No branches or pull requests

2 participants