Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Remove direct calls to methods of components in unit tests - Closes #703 #954

Merged
merged 9 commits into from
Nov 8, 2017

Conversation

reyraa
Copy link
Contributor

@reyraa reyraa commented Nov 3, 2017

What was the problem?

Preferred is not to call any component method directly in unit tests. same goes for setState and other react related methods.

How did I fix it?

I'm using enzyme event simulation to trigger all the required changes to test the methods of our components.

How to test it?

Check the code syntax in unit tests. there should be no call for setState, wrapper.instance or any of the direct methods of the components.

Review checklist

@reyraa reyraa self-assigned this Nov 3, 2017
@reyraa reyraa changed the title 703 unit tests Remove direct calls to methods of components in unit tests - Closes #703 Nov 6, 2017
@reyraa reyraa requested review from slaweet and yasharAyari November 6, 2017 08:42
@slaweet slaweet changed the base branch from development to 1.3.0 November 6, 2017 10:33
yasharAyari
yasharAyari previously approved these changes Nov 6, 2017
Copy link
Contributor

@slaweet slaweet left a comment

Choose a reason for hiding this comment

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

Thank you, Ali. The tests now look a lot better.

@reyraa reyraa merged commit 025c683 into 1.3.0 Nov 8, 2017
@reyraa reyraa deleted the 703-unit-tests branch November 8, 2017 08:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants