-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Migrate getEntityRecords resolver to thunks #34578
Conversation
Size Change: +13 B (0%) Total Size: 1.04 MB
ℹ️ View Unchanged
|
// Provide entities and acquire lock | ||
fulfillment.next( ENTITIES ); | ||
// Provide response | ||
triggerFetch.mockImplementation( () => POST_TYPES ); |
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.
.mockResolvedValue( POST_TYPES )
const p = new Promise( ( resolve ) => setTimeout( resolve ) ); | ||
jest.runAllTimers(); | ||
await p; | ||
} |
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 have a hard time understanding what is this integration test testing. Instead of calling jest.runAllTimers()
all the time, can we use jest.useRealTimers()
and properly await a relevant promise before asserting some fact? That's a suggestion for a rewrite in another PR. For now, hacking our way through the test is probably OK.
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.
The e2e tests are failing, and the failure looks real:
TimeoutError: waiting for selector `.editor-post-saved-state.is-saved` failed: timeout 30000ms exceeded
d7a034f
to
0bc4da8
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.
👍 now that e2es are green.
Builds on top of the thunks support added in #27276 and refactors just the parts of core-data required to make the
getEntityRecords
work (this PR is a minimal viable subset of #28389).Test plan:
Confirm the automated tests pass
blog title
block, edit it, save the post and related entities