Skip to content

Async tests#634

Merged
JedWatson merged 6 commits intoJedWatson:masterfrom
bruderstein:async-tests
Nov 29, 2015
Merged

Async tests#634
JedWatson merged 6 commits intoJedWatson:masterfrom
bruderstein:async-tests

Conversation

@bruderstein
Copy link
Collaborator

Add tests for Select.Async

These tests use the shallow renderer to test Select.Async. There's one bug fix, for a minor edge case in
9aa600b to do with the cache and out-of-order responses.

Fixes #615

+ the first few tests for Select.Async, using the shallow renderer
+ removed redundant asyncOptions tests from Select-test
+ Changes Select.Async thenPromise to return the resulting promise if handled with 
promises - no change to usage, but makes testing easier as it is possible to just wait
for the returned promise from thenPromise to complete before asserting the changes.
+ Added dev dependency to unexpected-react, to ease testing with the shallow renderer
Documented in the test case
Changed the cache checking to start with the full search string, and then decrease 
the length.
The DOM is still needed for the other tests, and `npm test` may run the async tests
first.  This means React is already required, and has already decided that there is no
DOM, hence `TestUtils.renderIntoDocument` won't work. Adding the DOM emulation
to Async-test fixes this problem.
Treats as if the options list was empty
@JedWatson
Copy link
Owner

Woo!! 🎉 🎈

JedWatson added a commit that referenced this pull request Nov 29, 2015
@JedWatson JedWatson merged commit 8621180 into JedWatson:master Nov 29, 2015
@JedWatson
Copy link
Owner

So great, thanks @bruderstein 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for Async component

2 participants