-
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
[Security Solution] Replace EUI theme with mocks in jest suites #92462
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
e795aaa
to
a364413
Compare
Previously there were a large number of jest specs that utilized the ThemeProvider (from styled-components package) to inject EUI themes into the mounted components. The full EUI theme is almost never necessary for unit tests as each tested component usually consumes no more than a single field or two from the EUI theme. In certain cases, the theme was not used at all. This change is intended to remove all unnecessary ThemeProviders from the suites, and replaces the imported EUI theme json files with mock themes customized for each tested component. With this change, snapshots are now significantly smaller, and tests are lighter. Closes elastic#64092.
a364413
to
401aff9
Compare
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @ecezalp |
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 for paying down some tech debt here, it's much appreciated!
@@ -1,865 +1,161 @@ | |||
// Jest Snapshot v1, https://goo.gl/fbAQLP | |||
|
|||
exports[`Paginated Table Component rendering it renders the default load more table 1`] = ` | |||
<ContextProvider |
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.
💯
|
||
.c3 { | ||
padding: 16px; | ||
background-color: #ece; |
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.
😉
…tiple-searchable-snapshot-actions * 'master' of github.com:elastic/kibana: [Rollup] Fix use of undefined value in JS import (elastic#92791) [ILM] Fix replicas not showing (elastic#92782) [Event Log] Extended README.md with the documentation for a REST API and Start plugin contract. (elastic#92562) [XY] Enables page reload toast for the legacyChartsLibrary setting (elastic#92811) [Security Solution][Case] Improve hooks (elastic#89580) [Security Solution] Update wordings and breadcrumb for timelines page (elastic#90809) [Security Solution] Replace EUI theme with mocks in jest suites (elastic#92462) docs: ✏️ use correct heading level (elastic#92806) [ILM ] Fix logic for showing/hiding recommended allocation on Cloud (elastic#90592) [Security Solution][Detections] Pull gap detection logic out in preparation for sharing between rule types (elastic#91966) [core.savedObjects] Remove _shard_doc tiebreaker since ES now adds it automatically. (elastic#92295) docs: ✏️ fix links in embeddable plugin readme (elastic#92778) # Conflicts: # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…tic#92462) Previously there were a large number of jest specs that utilized the ThemeProvider (from styled-components package) to inject EUI themes into the mounted components. The full EUI theme is almost never necessary for unit tests as each tested component usually consumes no more than a single field or two from the EUI theme. In certain cases, the theme was not used at all. This change is intended to remove all unnecessary ThemeProviders from the suites, and replaces the imported EUI theme json files with mock themes customized for each tested component. With this change, snapshots are now significantly smaller, and tests are lighter. Closes elastic#64092.
…) (#93336) Previously there were a large number of jest specs that utilized the ThemeProvider (from styled-components package) to inject EUI themes into the mounted components. The full EUI theme is almost never necessary for unit tests as each tested component usually consumes no more than a single field or two from the EUI theme. In certain cases, the theme was not used at all. This change is intended to remove all unnecessary ThemeProviders from the suites, and replaces the imported EUI theme json files with mock themes customized for each tested component. With this change, snapshots are now significantly smaller, and tests are lighter. Closes #64092.
Summary
Previously there were a large number of jest specs that utilized the
ThemeProvider (from styled-components package) to inject EUI themes
into the mounted components. The full EUI theme is almost never
necessary for unit tests as each tested component usually consumes no
more than a single field or two from the EUI theme. In certain cases,
the theme was not used at all. This change removes all unnecessary
ThemeProviders from the suites, and replaces the imported EUI theme
json files with mock themes customized for each tested component. With
this change, snapshots are now significantly smaller, and tests are
lighter.
Closes #64092.
Checklist
Testing Scenario
To ensure all tests are green, please cd into
kibana/x-pack
and runnode scripts/jest.js security_solution