-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiTextTruncate] Fix testenv
mocks
#7234
Merged
Merged
Conversation
This file contains 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
- 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`
Preview staging links for this PR:
|
💚 Build Succeeded
|
breehall
approved these changes
Sep 29, 2023
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.
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!
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))
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
TruncationUtils
testenv 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
TruncationUtils
as wellQA
EUI testing
yarn test-unit text_truncate
passesyarn test-unit services/canvas
passesyarn test-unit combo_box
passesKibana testing
yarn build-pack
yarn kbn bootstrap --no-validate
yarn test:jest x-pack/plugins/monitoring/public/components/renderers
and ensure all tests passGeneral checklist
- [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)