-
Notifications
You must be signed in to change notification settings - Fork 222
Conversation
09568e3
to
3175af5
Compare
if (returnValue instanceof Promise) { | ||
return returnValue.then(ret => { | ||
if (isPromise(returnValue)) { | ||
return Promise.resolve(promise as Promise<any>).then(ret => { |
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.
Should leave a comment of why you check that returnValue
is a promise, not promise
|
||
return result; | ||
if (isPromise(result)) { | ||
return Promise.resolve(promise).then(afterResolve) as any; |
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.
Same request as above re: clarifying comments for this and the type casting of act
above
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.
This looks good to me f you address the unnecessary awaits, rebase on master, and remove the skip
from the test in react-form
88cdc45
to
281f33c
Compare
281f33c
to
54a4850
Compare
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.
A few more comments, but overall I think this is looking good to ship now 👍
.find('button', {type: 'submit'})! | ||
.trigger('onClick', clickEvent()); | ||
wrapper.act(() => { | ||
wrapper |
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.
I don't think you should need to wrap this in an act?
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.
Removing fails the test actually. It can't find the element.
.find('button', {type: 'submit'})! | ||
.trigger('onClick', clickEvent()); | ||
wrapper.act(() => { | ||
wrapper |
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.
Same as above
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.
Same, same as above.
importRemote.act(() => { | ||
requestIdleCallback.runIdleCallbacks(); | ||
await importRemote.act(async () => { | ||
await requestIdleCallback.runIdleCallbacks(); |
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.
We should be able to await on the result of calling load
instead then?
54a4850
to
ed3a5b1
Compare
This pull closes https://github.com/Shopify/web/issues/13363 by upgrading to React@16.9.0.alpha0, this includes:
react
andreact-dom
(note, there are no tags for the updated types yet)react-testing
library🎩 There should be no failing tests, no async-act related skipped tests and no act-related console errors.