-
Notifications
You must be signed in to change notification settings - Fork 50.2k
Fixed ReactNativeFiber event handling regression #8959
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,8 @@ var UIManager; | |
|
|
||
| describe('ReactNative', () => { | ||
| beforeEach(() => { | ||
| jest.resetModules(); | ||
|
|
||
| React = require('React'); | ||
| ReactNative = require('ReactNative'); | ||
| UIManager = require('UIManager'); | ||
|
|
@@ -45,17 +47,17 @@ describe('ReactNative', () => { | |
|
|
||
| ReactNative.render(<View foo="foo" />, 11); | ||
|
|
||
| expect(UIManager.createView.mock.calls.length).toBe(2); | ||
| expect(UIManager.setChildren.mock.calls.length).toBe(2); | ||
| expect(UIManager.createView.mock.calls.length).toBe(1); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see changes to this test but no changes to how stack works. So how did this pass before vs. now? EDIT: Oh nvm. I get it. This used to be dependent on module state between resets.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup. Noticed this when fit() running the test. |
||
| expect(UIManager.setChildren.mock.calls.length).toBe(1); | ||
| expect(UIManager.manageChildren).not.toBeCalled(); | ||
| expect(UIManager.updateView).not.toBeCalled(); | ||
|
|
||
| ReactNative.render(<View foo="bar" />, 11); | ||
|
|
||
| expect(UIManager.createView.mock.calls.length).toBe(2); | ||
| expect(UIManager.setChildren.mock.calls.length).toBe(2); | ||
| expect(UIManager.createView.mock.calls.length).toBe(1); | ||
| expect(UIManager.setChildren.mock.calls.length).toBe(1); | ||
| expect(UIManager.manageChildren).not.toBeCalled(); | ||
| expect(UIManager.updateView).toBeCalledWith(3, 'View', { foo: 'bar' }); | ||
| expect(UIManager.updateView).toBeCalledWith(2, 'View', { foo: 'bar' }); | ||
| }); | ||
|
|
||
| it('returns the correct instance and calls it in the callback', () => { | ||
|
|
||
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.
Unrelated: There's some slow paths here that we should look into optimizing.