Skip to content
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

More declarative component tests using jest-dom/extend-expect #2654

Merged
merged 1 commit into from May 15, 2019

Conversation

julienben
Copy link
Member

Merging #2646 into dev. Work by @tigranpetrossian.

* Make jest-dom available globally

* Refactor link component to use jest-dom

* Refactor component tests to use jest-dom matchers

Additionally:
- Replace manual DOM queries with native querying methods from `testing-library`
- Use `react-testing-library` renderer for snapshot testing, instead of `react-test-renderer`

* Assign the console spy in Img test to a variable

Eslint catches `expect(console.error)` assertions as a console usage. Assigning the spy to a variable solves the issue without having to disable the rule locally.

* Refactor container tests to use jest-dom matchers
@julienben julienben requested a review from gretzky May 13, 2019 16:09
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 2eaaf48 on jest-dom-extend-expect into 3357b5b on dev.

@julienben
Copy link
Member Author

julienben commented May 15, 2019

@gretzky Can you please approve this when you get a chance? It's the same changes as #2646 which you've already approved but Travis wasn't triggered there so I opened this instead.

Copy link
Collaborator

@jwinn jwinn left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@julienben
Copy link
Member Author

Thanks @jwinn!

@julienben julienben merged commit a7e81dc into dev May 15, 2019
@julienben julienben deleted the jest-dom-extend-expect branch May 15, 2019 13:47
@lock
Copy link

lock bot commented Jun 14, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants