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

hooks testcase written #2029

Open
wants to merge 17 commits into
base: master
from

Conversation

3 participants
@k3ithl1m
Copy link
Contributor

k3ithl1m commented Mar 3, 2019

Test cases written to test useState and useEffect

k3ithl1m added some commits Mar 3, 2019

@k3ithl1m k3ithl1m referenced this pull request Mar 3, 2019

Open

React hooks support checklist #2011

0 of 11 tasks complete
@k3ithl1m

This comment has been minimized.

Copy link
Contributor Author

k3ithl1m commented Mar 5, 2019

@pgangwani
Copy link

pgangwani left a comment

@k3ithl1m : Could you please add testcase to simulate wrapper.setProps() to get new initial state from props (simulate to test concepts : getDerivedStateFromProps or componentWillReceiveProps) passing initialFooVal
act(() => { wrapper.setProps({ initialFooVal: "HELLO" }); });

@k3ithl1m

This comment has been minimized.

Copy link
Contributor Author

k3ithl1m commented Mar 6, 2019

@pgangwani Sounds like a plan

@ljharb
Copy link
Member

ljharb left a comment

Thanks, this is a great start.

Show resolved Hide resolved packages/enzyme-test-suite/test/ReactWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ReactWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ReactWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ReactWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ReactWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx Outdated
Show resolved Hide resolved packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx Outdated

@ljharb ljharb referenced this pull request Mar 7, 2019

Open

[WIP] Support React hooks `useState` #2008

4 of 7 tasks complete

@ljharb ljharb added this to Lifecycles in React 16 Mar 7, 2019

@ljharb ljharb moved this from Lifecycles to v16.8+: Hooks in React 16 Mar 7, 2019

ljharb and others added some commits Mar 9, 2019

Update packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
Update packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Co-Authored-By: k3ithl1m <keithlimweiluen@gmail.com>
@k3ithl1m

This comment has been minimized.

Copy link
Contributor Author

k3ithl1m commented Mar 9, 2019

@pgangwani @ljharb I've added the component will receive props test case. Let me know if there are any other changes

@pgangwani

This comment has been minimized.

Copy link

pgangwani commented Mar 10, 2019

@k3ithl1m there is #2041 also open. Lets wait for it getting merged then I would work with you ( and whoever else intrested) to implement all remaining test cases specifically for react hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.