-
Notifications
You must be signed in to change notification settings - Fork 8.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
Upgarde enzyme to v3.10.0 #38766
Upgarde enzyme to v3.10.0 #38766
Conversation
*update snapshots (React components which are using Memo()); *revert pending test in list_control_editor.test.js; *replace component.html() and component.text() function calls which expect null to component.isEmptyRender() for consistency
💔 Build Failed |
💔 Build Failed |
@@ -59,7 +59,7 @@ describe('Toaster', () => { | |||
if (toasts.length === 0) { | |||
dispatch({ type: 'addToaster', toast: mockToast }); | |||
} | |||
}); | |||
}, []); |
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.
@XavierM
I've added it because of previous version of enzyme had a gap in calling hooks.
Without adding call this effect only after the first render
the test fails, because of when click the btn and dispatch deleteToaster
-> the toasts
array becomes empty and useEffect
will return in the game and will add new toast.
💚 Build Succeeded |
Pinging @elastic/kibana-platform |
💚 Build Succeeded |
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 changes LGTM.
💚 Build Succeeded |
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, thanks!
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.
ML edit LGTM
* Upgarde enzyme to v3.10.0 *update snapshots (React components which are using Memo()); *revert pending test in list_control_editor.test.js; *replace component.html() and component.text() function calls which expect null to component.isEmptyRender() for consistency # Conflicts: # x-pack/plugins/siem/public/components/toasters/index.test.tsx
* Upgarde enzyme to v3.10.0 *update snapshots (React components which are using Memo()); *revert pending test in list_control_editor.test.js; *replace component.html() and component.text() function calls which expect null to component.isEmptyRender() for consistency # Conflicts: # x-pack/plugins/siem/public/components/toasters/index.test.tsx
Summary
The PR updates airbnb/enzyme and dependent libs to the latest. It is necessary for enabling a unit test in
src/legacy/core_plugins/input_control_vis/public/components/editor/list_control_editor.test.js
, which was disabled in #37064The PR includes next changes:
Memo()
);component.html()
andcomponent.text()
function callswhich expect
null
values tocomponent.isEmptyRender()
for consistency - the discussion and an enzyme maintainer suggestionChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers