[EuiTextTruncate] Fix testenv mocks#7234
Merged
cee-chen merged 4 commits intoelastic:mainfrom Sep 29, 2023
Merged
Conversation
- separating it from EuiTextTruncate utils makes it easier to mock without shenanigans - since it's being used outside of truncation contexts, might as well make it a generic service
- to only mock the canvas util (which is the one with Jest dependency issues, not the text truncation util itself)
- move canvas tests out of text_truncate - update existing method of mocking canvas width, since the new `testenv` file now allows bypassing setting `HTMLCanvasElement`
Contributor
Author
|
Preview staging links for this PR:
|
Collaborator
💚 Build Succeeded
|
breehall
approved these changes
Sep 29, 2023
Contributor
breehall
left a comment
There was a problem hiding this comment.
This change makes the service easy to reuse if we need to in the future. I pulled this branch locally to validate tests after reviewing code - no failing tests. Let's unblock Kibana!
Contributor
Author
|
Thanks a million Bree! |
cee-chen
added a commit
to elastic/kibana
that referenced
this pull request
Oct 4, 2023
`v88.5.0`⏩`v88.5.4` This EUI upgrade helps unblock the Shared UX team with some beta serverless nav updates not listed in the below changelog (elastic/eui#7228 and elastic/eui#7248). --- ## [`88.5.4`](https://github.com/elastic/eui/tree/v88.5.4) - This release contains internal changes to a beta component needed by Kibana. ## [`88.5.3`](https://github.com/elastic/eui/tree/v88.5.3) **Bug fixes** - Fixed `EuiComboBox` search input width not resetting correctly on selection ([#7240](elastic/eui#7240)) ## [`88.5.2`](https://github.com/elastic/eui/tree/v88.5.2) **Bug fixes** - Fixed broken `EuiTextTruncate` testenv mocks ([#7234](elastic/eui#7234)) ## [`88.5.1`](https://github.com/elastic/eui/tree/v88.5.1) - Improved the performance of `EuiComboBox` by removing the `react-autosizer-input` dependency ([#7215](elastic/eui#7215)) **Dependency updates** - Updated `react-element-to-jsx-string` to v5.0.0 ([#7214](elastic/eui#7214)) - Removed unused `@types/vfile-message` dependency ([#7214](elastic/eui#7214))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
😬 I messed up the
TruncationUtilstestenv mocks I set up in #7215 and they're currently causing Kibana CI to throw a bunch of Jest super errors.This PR should resolve the issues by narrowing down our mocks to only the canvas APIs that don't exist in Jest/JSDOM, as opposed to attempting to mock
TruncationUtilsas wellQA
EUI testing
yarn test-unit text_truncatepassesyarn test-unit services/canvaspassesyarn test-unit combo_boxpassesKibana testing
yarn build-packyarn kbn bootstrap --no-validateyarn test:jest x-pack/plugins/monitoring/public/components/renderersand ensure all tests passGeneral checklist
- [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)