[Security Solution] Replace EUI theme with mocks in jest suites#92462
Merged
ecezalp merged 2 commits intoelastic:masterfrom Feb 25, 2021
Merged
[Security Solution] Replace EUI theme with mocks in jest suites#92462ecezalp merged 2 commits intoelastic:masterfrom
ecezalp merged 2 commits intoelastic:masterfrom
Conversation
Contributor
|
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
Contributor
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @ecezalp |
rylnd
approved these changes
Feb 25, 2021
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`Paginated Table Component rendering it renders the default load more table 1`] = ` | ||
| <ContextProvider |
|
|
||
| .c3 { | ||
| padding: 16px; | ||
| background-color: #ece; |
jloleysens
added a commit
to jloleysens/kibana
that referenced
this pull request
Feb 25, 2021
…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
Contributor
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Contributor
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
ecezalp
added a commit
to ecezalp/kibana
that referenced
this pull request
Mar 2, 2021
…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.
ecezalp
added a commit
that referenced
this pull request
Mar 3, 2021
…) (#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.
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
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-packand runnode scripts/jest.js security_solution