-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[PLT-7814] Upgrade to enzyme-adapter-react-16 and enable unit/components tests at Jenkins build #303
Conversation
…with dependencies using react 16 Portals), enable jest at Jenkins build
As a general principle, I'm really against commenting out tests since they have a tendency to just sit in the codebase and rot. If you intend to update these, I would recommend deleting them instead and giving yourself a JIRA ticket. That eliminates the possibility that they'll just rot and makes it much more likely that they'll get updated eventually, keeping our code prettier and more navigable in the meantime. It also allows you to better capture the work you have to do when planning or reviewing your sprints. Git was literally made for preserving old versions of our code. We don't need comments for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment. I feel pretty strongly about it, but I'm not gonna block the review on it.
I understand. I left it that way since most of those were written by community contributors. But anyway, I'll send update removing those commented lines, and will just put back whenever |
Updated PR and description above, adding Jira ticket assigned to me - https://mattermost.atlassian.net/browse/PLT-8133 - to revert component tests. |
I forgot this one. I added clearMocks (set to true) to jest config. This is to automatically clear mock calls and instances between every test. |
… which fix React 16 Portals issue
I noticed that the awaited PR for |
@saturninoabril Can you resubmit this as a branch on the mattermost-webapp repository? I have jenkins configured to not trust Jenkinsfile changes that are not from branches on the main repo. |
@crspeller Noted. Submitted branch - #310 |
Summary
This is the final batch for PLT-7814, resolving existing (and additional) component test failures.
Included in this PR:
(UPDATE)
1. Upgrade toenzyme-adapter-react-16
with the recent upgrade to React 16- encountered several test suites failures likeError: Enzyme Internal Error: unknown node with tag 4
due to issue on Enzyme 3- it turned out that Adapter React 16 does not support new Portal node types. Though we are not using Portals, our dependencies do like the Modal ofreact-bootstrap
.- affected test cases were temporarilydisabledremoved (instead of making workaround) until this PR enzymejs/enzyme#1263 toenzyme-adapter-react-16
gets merged.make test
commandmake test
to PR checklistreducers
andselectors
folders for test coverage computation"clearMocks": true
to jest config to automatically clear mock calls and instances between every test.Ticket Link
Jira ticket: PLT-7814
(UPDATE): Jira ticket to revert component tests - PLT-8133
Checklist
make check-style
to check for style errors (required for all pull requests)