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

Fix CurrentEuiBreakpoint testenv mocks #6117

Merged
merged 7 commits into from
Aug 9, 2022

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Aug 9, 2022

Summary

@thompsongl your comments in the previous breakpoint PR made me realize I'd also done the .testenv mock for useCurrentEuiBreakpoint incorrectly. I only mocked the hook itself, but the file also had an exported context and provider component that was missing in our compiled test-env directory.

To solve the issue I decided to split the hook out into its own file and only mock that instead of attempting to mock provider logic (as I think that makes sense to leave as-is).

I don't think this affects Kibana since it's unlikely that there's any Kibana usages yet, but let me know if not.

Checklist

  • yarn build-pack and inspect test-env dir
  • EUI Jest tests pass
  • Kibana Jest tests pass
    - [ ] A changelog entry exists and is marked appropriately Not sure if this is needed - thoughts?

@cee-chen cee-chen marked this pull request as ready for review August 9, 2022 19:41
@thompsongl
Copy link
Contributor

To solve the issue I decided to split the hook out into its own file and only mock that instead of attempting to mock provider logic (as I think that makes sense to leave as-is).

Good idea

I don't think this affects Kibana since it's unlikely that there's any Kibana usages yet, but let me know if not.

We can always backport this if we find problems in Kibana

@kibanamachine
Copy link

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

- stopped being an issue after the circular dependency was resolved
@cee-chen cee-chen enabled auto-merge (squash) August 9, 2022 22:12
@kibanamachine
Copy link

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

@cee-chen cee-chen merged commit 8d07a5a into elastic:main Aug 9, 2022
@cee-chen cee-chen deleted the current-breakpoint-testenv-fix branch August 9, 2022 23:06
pull bot pushed a commit to e-ntro-py/eui that referenced this pull request Aug 15, 2022
* [Misc] Rename current breakpoint files to use snake_casing to match rest of repo

* Move out useCurrentEuiBreakpoint hook to separate file to fix testenv behavior

* Update changed EuiPageTemplate snapshots as a result of this fix

* Fix circular dependency

* Fix SSR/typeof undefined issue 🤦

* Revert snapshots

- stopped being an issue after the circular dependency was resolved

* Changelog
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.

3 participants