-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fix store crash with gutenberg master #1366
Conversation
This is looking good! Did a quick smoke test to see how this was progressing and everything seems to be working. This branch does show some problems that have been fixed on |
@@ -22,17 +22,20 @@ describe( 'RootComponent', () => { | |||
|
|||
it( 'renders without crashing', () => { | |||
const app = renderer.create( <RootComponent /> ); | |||
renderer.act( () => { | |||
jest.runAllTicks(); |
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.
Interesting!
Can we add a comment saying why/when is this needed? 🤔
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.
Added one here for the same reason.
It seems that when EDIT_ENTITY_RECORD
is dispatched using this generator function it's done so asynchronously, meaning the promise does not resolve immediately even during tests.
Which makes resetEditorBlocks
async which means setupEditorState
which comes right after is delayed which means isReady
will be true
after some time which means editorDidMount
will also be called after some time.
This is related to the changes made on core data entities so I figured it was safe to update our tests for now. I'll try to find a good explanation for this and add something 👍
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 is very inconvenient to enforce running fake timers but I guess this is what it is. I don't think we use unit tests to test the root component for the web code.
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.
LGTM!
Other than the minor styling issue with the heading level icons (noted in the gutenberg pr) this looks good. Going ahead and approving this since I think that issue is fine to address separately.
Fixes #1332
This PR brings us back to targeting gutenberg
master
Gutenberg PR: WordPress/gutenberg#17228
To test:
Update release notes:
RELEASE-NOTES.txt
.