testing-library / testing-playground

Simple and complete DOM testing playground that encourage good testing practices.
https://testing-playground.com
MIT License
788 stars 62 forks source link

test: add cypress end-to-end test setup #313

Closed ddehart closed 3 years ago

ddehart commented 3 years ago

What:

This PR relates to #7 and replaces #27 while incorporating a lot of what @JacobMGEvans learned while working on that PR.

Why:

End-to-end tests can help combat unintentional side effects and regressions.

How:

This PR adds a single end-to-end test that verifies the app's initial rendered state. It also adds some custom commands for Cypress to abstract some of the less obvious queries needed to test Testing Playground. Finally, it adds some properties to several components, some (data-testid) purely for Cypress/Testing Library queries and others (title) that improve both testability and accessibility.

Checklist:

JacobMGEvans commented 3 years ago

Awesome! Thanks for the credit, means a lot.

ddehart commented 3 years ago

@marcosvega91 done! Thanks for the review

smeijer commented 3 years ago

Thanks all!

Especially to @JacobMGEvans for all the time and energy you put into this under #27. I should have merged that one ages ago instead of delaying it because of some minor improvements. I'm truly sorry for that to have happened.

Also thanks for @ddehart for picking up that PR, and bring it to a mergeable state again. And to @marcosvega91 for the review. Much appreciated.

smeijer commented 3 years ago

:scream: I did it!

image

smeijer commented 3 years ago

@all-contributors please add @ddehart for test

allcontributors[bot] commented 3 years ago

@smeijer

I've put up a pull request to add @ddehart! :tada:

smeijer commented 3 years ago

@all-contributors please add @JacobMGEvans for test

allcontributors[bot] commented 3 years ago

@smeijer

I've put up a pull request to add @JacobMGEvans! :tada: