Skip to content
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

Mock EuiIcon in Jest #2878

Merged
merged 7 commits into from
Feb 25, 2020
Merged

Mock EuiIcon in Jest #2878

merged 7 commits into from
Feb 25, 2020

Conversation

thompsongl
Copy link
Contributor

@thompsongl thompsongl commented Feb 19, 2020

Summary

Uses the new testenv mock to replace EuiIcon in snapshot test output, eliminating the loading/loaded churn sometimes seen with async usage.

Closes #2765

Typical resulting diff is something like:

-   <svg
+   <div
      aria-hidden="true"
-     class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
-     focusable="false"
-     height="16"
-     role="img"
-     viewBox="0 0 16 16"
-     width="16"
-     xmlns="http://www.w3.org/2000/svg"
+     class="euiButtonIcon__icon"
+     data-euiicon-type="user"
    />

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in IE11 and Firefox
- [ ] Props have proper autodocs
- [ ] Added documentation examples

  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately

- [ ] Checked for accessibility including keyboard-only and screenreader modes

  • A changelog entry exists and is marked appropriately

@thompsongl thompsongl marked this pull request as ready for review February 20, 2020 16:23
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_2878/

@JoshMock
Copy link
Member

That comment was a test that I ran locally. Probably not an accurate rendering of this PR's change. 😄

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_2878/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_2878/

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshot updates look good. All tests pass and docs build.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_2878/

@thompsongl thompsongl merged commit 91d9e4d into elastic:master Feb 25, 2020
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_2878/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky Test: context_menu_panel icon loading
4 participants