From 97652c8c5b35bc966ec1ad39dfd3d631db8c38ee Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 15 Jan 2026 14:09:50 -0700 Subject: [PATCH 01/13] Update Emotion dependencies --- package.json | 10 +- .../kbn-css-utils/public/use_memo_css.ts | 2 +- .../packages/shared/kbn-test/jest-preset.js | 1 + .../jest/setup/enzyme_emotion_serializer.js | 79 +++++++++ .../shared/console/packaging/package.json | 4 +- .../unified_search/public/use_memo_css.ts | 1 + .../components/panel_text/panel_text.tsx | 3 +- yarn.lock | 166 ++++++++++-------- 8 files changed, 180 insertions(+), 86 deletions(-) create mode 100644 src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js create mode 100644 src/platform/plugins/shared/unified_search/public/use_memo_css.ts diff --git a/package.json b/package.json index 6166b7cc0179d..94f2cf723dcbc 100644 --- a/package.json +++ b/package.json @@ -144,11 +144,11 @@ "@elastic/search-ui": "1.24.1", "@elastic/search-ui-app-search-connector": "1.24.1", "@elastic/search-ui-engines-connector": "1.24.1", - "@emotion/cache": "11.11.0", - "@emotion/css": "11.11.0", - "@emotion/react": "11.11.1", - "@emotion/serialize": "1.1.2", - "@emotion/styled": "11.11.0", + "@emotion/cache": "11.14.0", + "@emotion/css": "11.13.5", + "@emotion/react": "11.14.0", + "@emotion/serialize": "1.3.3", + "@emotion/styled": "11.14.1", "@faker-js/faker": "9.7.0", "@formatjs/icu-messageformat-parser": "2.11.1", "@formatjs/intl": "2.10.2", diff --git a/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.ts b/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.ts index d33eaaa8e7e34..64ce865bd3dc3 100644 --- a/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.ts +++ b/src/platform/packages/shared/kbn-css-utils/public/use_memo_css.ts @@ -8,7 +8,7 @@ */ import { useMemo } from 'react'; -import type { CSSInterpolation } from '@emotion/css'; +import type { CSSInterpolation } from '@emotion/serialize'; import type { UseEuiTheme } from '@elastic/eui'; import { useEuiTheme } from '@elastic/eui'; diff --git a/src/platform/packages/shared/kbn-test/jest-preset.js b/src/platform/packages/shared/kbn-test/jest-preset.js index c5e6dbf9d932b..a98ae29bd1172 100644 --- a/src/platform/packages/shared/kbn-test/jest-preset.js +++ b/src/platform/packages/shared/kbn-test/jest-preset.js @@ -95,6 +95,7 @@ module.exports = { // A list of paths to snapshot serializer modules Jest should use for snapshot testing snapshotSerializers: [ '/src/platform/packages/shared/react/kibana_mount/test_helpers/react_mount_serializer.ts', + '/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js', 'enzyme-to-json/serializer', '/src/platform/packages/shared/kbn-test/src/jest/setup/emotion.js', ], diff --git a/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js b/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js new file mode 100644 index 0000000000000..203a44eef9001 --- /dev/null +++ b/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +/** + * Custom serializer to handle Emotion-styled components in Enzyme shallow renders. + * This must run BEFORE enzyme-to-json to properly transform Emotion components. + * + * The problem: When using Enzyme's shallow() with Emotion-styled components, + * the component's internal structure (ForwardRef, __EMOTION_TYPE_PLEASE_DO_NOT_USE__) + * gets exposed in snapshots. This serializer intercepts those components and + * transforms them to match the expected format before enzyme-to-json processes them. + */ +module.exports = { + test(val) { + // Check if this is a shallow-rendered Enzyme wrapper containing an Emotion component + // We need to check for the Enzyme wrapper structure and Emotion internals + if (!val || typeof val !== 'object') { + return false; + } + + // Check if this is an Enzyme ShallowWrapper with Emotion props + if (val.type && val.props && val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__) { + return true; + } + + return false; + }, + serialize(val, config, indentation, depth, refs, printer) { + const props = { ...val.props }; + + // Get the original component type before we modify props + const emotionType = props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__; + + // Simplify the css prop to match the old snapshot format + if (props.css && typeof props.css === 'object') { + props.css = 'unknown styles'; + } + + // Remove Emotion internals from props + delete props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__; + + // Try to get the original component name from Emotion's internal type + let componentName = null; + if (emotionType) { + // If emotionType is a string (like 'div', 'span'), use it directly + if (typeof emotionType === 'string') { + componentName = emotionType; + } + // Emotion wraps components, try to get the display name + else if (emotionType.displayName) { + componentName = emotionType.displayName; + } else if (emotionType.name) { + componentName = emotionType.name; + } else if (typeof emotionType === 'function' && emotionType.render) { + componentName = emotionType.render.displayName || emotionType.render.name; + } + } + + // Return the cleaned up component structure + // Only replace the type if we successfully extracted a component name + return printer( + { + ...val, + type: componentName || val.type, // Preserve original type if we couldn't extract one + props, + }, + config, + indentation, + depth, + refs + ); + }, +}; diff --git a/src/platform/plugins/shared/console/packaging/package.json b/src/platform/plugins/shared/console/packaging/package.json index e94ec13387825..bc0004e4bcd69 100644 --- a/src/platform/plugins/shared/console/packaging/package.json +++ b/src/platform/plugins/shared/console/packaging/package.json @@ -6,8 +6,8 @@ "types": "../target/index.d.ts", "peerDependencies": { "@elastic/eui": "102.2.0", - "@emotion/css": "^11.11.0", - "@emotion/react": "^11.0.0", + "@emotion/css": "^11.13.5", + "@emotion/react": "^11.14.0", "classnames": "2.5.1", "react": "^17", "react-markdown": "^6.0.3", diff --git a/src/platform/plugins/shared/unified_search/public/use_memo_css.ts b/src/platform/plugins/shared/unified_search/public/use_memo_css.ts new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/src/platform/plugins/shared/unified_search/public/use_memo_css.ts @@ -0,0 +1 @@ + diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/panel_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/panel_text.tsx index dc6eb2d977429..e2f7fa1205e1a 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/panel_text.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/panel_text.tsx @@ -5,7 +5,8 @@ * 2.0. */ import React, { type PropsWithChildren } from 'react'; -import { css, type CSSInterpolation } from '@emotion/css'; +import { css } from '@emotion/css'; +import type { CSSInterpolation } from '@emotion/serialize'; import { EuiText, useEuiTheme, type EuiTextProps } from '@elastic/eui'; import { useKibanaIsDarkMode } from '@kbn/react-kibana-context-theme'; diff --git a/yarn.lock b/yarn.lock index fedb86da6b5b5..6fce3e994d73d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2937,16 +2937,16 @@ dependencies: "@babel/plugin-syntax-jsx" "^7.17.12" -"@emotion/babel-plugin@^11.11.0": - version "11.11.0" - resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz#c2d872b6a7767a9d176d007f5b31f7d504bb5d6c" - integrity sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ== +"@emotion/babel-plugin@^11.11.0", "@emotion/babel-plugin@^11.13.5": + version "11.13.5" + resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz#eab8d65dbded74e0ecfd28dc218e75607c4e7bc0" + integrity sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ== dependencies: "@babel/helper-module-imports" "^7.16.7" "@babel/runtime" "^7.18.3" - "@emotion/hash" "^0.9.1" - "@emotion/memoize" "^0.8.1" - "@emotion/serialize" "^1.1.2" + "@emotion/hash" "^0.9.2" + "@emotion/memoize" "^0.9.0" + "@emotion/serialize" "^1.3.3" babel-plugin-macros "^3.1.0" convert-source-map "^1.5.0" escape-string-regexp "^4.0.0" @@ -2964,15 +2964,15 @@ "@emotion/babel-plugin" "^11.11.0" "@emotion/babel-plugin-jsx-pragmatic" "^0.2.1" -"@emotion/cache@11.11.0", "@emotion/cache@^11.11.0", "@emotion/cache@^11.4.0": - version "11.11.0" - resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.11.0.tgz#809b33ee6b1cb1a625fef7a45bc568ccd9b8f3ff" - integrity sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ== +"@emotion/cache@11.14.0", "@emotion/cache@^11.13.5", "@emotion/cache@^11.14.0", "@emotion/cache@^11.4.0": + version "11.14.0" + resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.14.0.tgz#ee44b26986eeb93c8be82bb92f1f7a9b21b2ed76" + integrity sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA== dependencies: - "@emotion/memoize" "^0.8.1" - "@emotion/sheet" "^1.2.2" - "@emotion/utils" "^1.2.1" - "@emotion/weak-memoize" "^0.3.1" + "@emotion/memoize" "^0.9.0" + "@emotion/sheet" "^1.4.0" + "@emotion/utils" "^1.4.2" + "@emotion/weak-memoize" "^0.4.0" stylis "4.2.0" "@emotion/css-prettifier@^1.1.3": @@ -2983,29 +2983,36 @@ "@emotion/memoize" "^0.8.1" stylis "4.2.0" -"@emotion/css@11.11.0": - version "11.11.0" - resolved "https://registry.yarnpkg.com/@emotion/css/-/css-11.11.0.tgz#dad6a27a77d5e5cbb0287674c3ace76d762563ca" - integrity sha512-m4g6nKzZyiKyJ3WOfdwrBdcujVcpaScIWHAnyNKPm/A/xJKwfXPfQAbEVi1kgexWTDakmg+r2aDj0KvnMTo4oQ== +"@emotion/css@11.13.5": + version "11.13.5" + resolved "https://registry.yarnpkg.com/@emotion/css/-/css-11.13.5.tgz#db2d3be6780293640c082848e728a50544b9dfa4" + integrity sha512-wQdD0Xhkn3Qy2VNcIzbLP9MR8TafI0MJb7BEAXKp+w4+XqErksWR4OXomuDzPsN4InLdGhVe6EYcn2ZIUCpB8w== dependencies: - "@emotion/babel-plugin" "^11.11.0" - "@emotion/cache" "^11.11.0" - "@emotion/serialize" "^1.1.2" - "@emotion/sheet" "^1.2.2" - "@emotion/utils" "^1.2.1" + "@emotion/babel-plugin" "^11.13.5" + "@emotion/cache" "^11.13.5" + "@emotion/serialize" "^1.3.3" + "@emotion/sheet" "^1.4.0" + "@emotion/utils" "^1.4.2" -"@emotion/hash@^0.9.1": - version "0.9.1" - resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.9.1.tgz#4ffb0055f7ef676ebc3a5a91fb621393294e2f43" - integrity sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ== +"@emotion/hash@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.9.2.tgz#ff9221b9f58b4dfe61e619a7788734bd63f6898b" + integrity sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g== -"@emotion/is-prop-valid@1.2.1", "@emotion/is-prop-valid@^1.1.0", "@emotion/is-prop-valid@^1.2.1": +"@emotion/is-prop-valid@1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz#23116cf1ed18bfeac910ec6436561ecb1a3885cc" integrity sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw== dependencies: "@emotion/memoize" "^0.8.1" +"@emotion/is-prop-valid@^1.1.0", "@emotion/is-prop-valid@^1.3.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz#e9ad47adff0b5c94c72db3669ce46de33edf28c0" + integrity sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw== + dependencies: + "@emotion/memoize" "^0.9.0" + "@emotion/jest@11.11.0": version "11.11.0" resolved "https://registry.yarnpkg.com/@emotion/jest/-/jest-11.11.0.tgz#4d64b33052308739dcdd7396fd2bc902f7244f82" @@ -3022,47 +3029,52 @@ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.1.tgz#c1ddb040429c6d21d38cc945fe75c818cfb68e17" integrity sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA== -"@emotion/react@11.11.1", "@emotion/react@^11.8.1": - version "11.11.1" - resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.11.1.tgz#b2c36afac95b184f73b08da8c214fdf861fa4157" - integrity sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA== +"@emotion/memoize@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.9.0.tgz#745969d649977776b43fc7648c556aaa462b4102" + integrity sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ== + +"@emotion/react@11.14.0", "@emotion/react@^11.8.1": + version "11.14.0" + resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.14.0.tgz#cfaae35ebc67dd9ef4ea2e9acc6cd29e157dd05d" + integrity sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA== dependencies: "@babel/runtime" "^7.18.3" - "@emotion/babel-plugin" "^11.11.0" - "@emotion/cache" "^11.11.0" - "@emotion/serialize" "^1.1.2" - "@emotion/use-insertion-effect-with-fallbacks" "^1.0.1" - "@emotion/utils" "^1.2.1" - "@emotion/weak-memoize" "^0.3.1" + "@emotion/babel-plugin" "^11.13.5" + "@emotion/cache" "^11.14.0" + "@emotion/serialize" "^1.3.3" + "@emotion/use-insertion-effect-with-fallbacks" "^1.2.0" + "@emotion/utils" "^1.4.2" + "@emotion/weak-memoize" "^0.4.0" hoist-non-react-statics "^3.3.1" -"@emotion/serialize@1.1.2", "@emotion/serialize@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.1.2.tgz#017a6e4c9b8a803bd576ff3d52a0ea6fa5a62b51" - integrity sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA== +"@emotion/serialize@1.3.3", "@emotion/serialize@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.3.3.tgz#d291531005f17d704d0463a032fe679f376509e8" + integrity sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA== dependencies: - "@emotion/hash" "^0.9.1" - "@emotion/memoize" "^0.8.1" - "@emotion/unitless" "^0.8.1" - "@emotion/utils" "^1.2.1" + "@emotion/hash" "^0.9.2" + "@emotion/memoize" "^0.9.0" + "@emotion/unitless" "^0.10.0" + "@emotion/utils" "^1.4.2" csstype "^3.0.2" -"@emotion/sheet@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.2.2.tgz#d58e788ee27267a14342303e1abb3d508b6d0fec" - integrity sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA== +"@emotion/sheet@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.4.0.tgz#c9299c34d248bc26e82563735f78953d2efca83c" + integrity sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg== -"@emotion/styled@11.11.0": - version "11.11.0" - resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.11.0.tgz#26b75e1b5a1b7a629d7c0a8b708fbf5a9cdce346" - integrity sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng== +"@emotion/styled@11.14.1": + version "11.14.1" + resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.14.1.tgz#8c34bed2948e83e1980370305614c20955aacd1c" + integrity sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw== dependencies: "@babel/runtime" "^7.18.3" - "@emotion/babel-plugin" "^11.11.0" - "@emotion/is-prop-valid" "^1.2.1" - "@emotion/serialize" "^1.1.2" - "@emotion/use-insertion-effect-with-fallbacks" "^1.0.1" - "@emotion/utils" "^1.2.1" + "@emotion/babel-plugin" "^11.13.5" + "@emotion/is-prop-valid" "^1.3.0" + "@emotion/serialize" "^1.3.3" + "@emotion/use-insertion-effect-with-fallbacks" "^1.2.0" + "@emotion/utils" "^1.4.2" "@emotion/stylis@^0.8.4": version "0.8.5" @@ -3074,30 +3086,30 @@ resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.8.0.tgz#a4a36e9cbdc6903737cd20d38033241e1b8833db" integrity sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw== +"@emotion/unitless@^0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.10.0.tgz#2af2f7c7e5150f497bdabd848ce7b218a27cf745" + integrity sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg== + "@emotion/unitless@^0.7.4": version "0.7.5" resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== -"@emotion/unitless@^0.8.1": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.8.1.tgz#182b5a4704ef8ad91bde93f7a860a88fd92c79a3" - integrity sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ== - -"@emotion/use-insertion-effect-with-fallbacks@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz#08de79f54eb3406f9daaf77c76e35313da963963" - integrity sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw== +"@emotion/use-insertion-effect-with-fallbacks@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz#8a8cb77b590e09affb960f4ff1e9a89e532738bf" + integrity sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg== -"@emotion/utils@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.2.1.tgz#bbab58465738d31ae4cb3dbb6fc00a5991f755e4" - integrity sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg== +"@emotion/utils@^1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.4.2.tgz#6df6c45881fcb1c412d6688a311a98b7f59c1b52" + integrity sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA== -"@emotion/weak-memoize@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz#d0fce5d07b0620caa282b5131c297bb60f9d87e6" - integrity sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww== +"@emotion/weak-memoize@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz#5e13fac887f08c44f76b0ccaf3370eb00fec9bb6" + integrity sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg== "@esbuild/aix-ppc64@0.25.9": version "0.25.9" From dd40898e79f955c2e0d95516962074805810a3c3 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 15 Jan 2026 14:40:50 -0700 Subject: [PATCH 02/13] debug the serializer --- .../jest/setup/enzyme_emotion_serializer.js | 67 ++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js b/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js index 203a44eef9001..f93578d8f2959 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js +++ b/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js @@ -16,16 +16,65 @@ * gets exposed in snapshots. This serializer intercepts those components and * transforms them to match the expected format before enzyme-to-json processes them. */ + +const util = require('util'); + module.exports = { test(val) { // Check if this is a shallow-rendered Enzyme wrapper containing an Emotion component // We need to check for the Enzyme wrapper structure and Emotion internals + + // DEEP INSPECTION: Log the actual structure of what we receive + try { + const valType = typeof val; + const isNull = val === null; + const isArray = Array.isArray(val); + + console.log(`[test-enzyme-emotion-serializer] ====== RECEIVED VALUE ======`); + console.log(`[test-enzyme-emotion-serializer] typeof: ${valType}, isNull: ${isNull}, isArray: ${isArray}`); + + if (valType === 'string' && val === '[object Object]') { + console.log(`[test-enzyme-emotion-serializer] ⚠️ STRING VALUE: "${val}" (this is a stringified object)`); + console.log(`[test-enzyme-emotion-serializer] Stack trace to see who stringified it:`); + console.trace(); + } else if (valType === 'object' && !isNull) { + // Show the actual object structure + console.log(`[test-enzyme-emotion-serializer] Object keys:`, Object.keys(val)); + console.log(`[test-enzyme-emotion-serializer] Object.type:`, val.type); + console.log(`[test-enzyme-emotion-serializer] Object.props keys:`, val.props ? Object.keys(val.props) : 'no props'); + + // Deep inspect with util + console.log(`[test-enzyme-emotion-serializer] Full structure:`, util.inspect(val, { depth: 2, colors: false })); + } + console.log(`[test-enzyme-emotion-serializer] ====== END RECEIVED VALUE ======`); + } catch (e) { + console.log(`[test-enzyme-emotion-serializer] Error inspecting value:`, e.message); + } + + // Quick checks for invalid values + // Note: Stringified objects like "[object Object]" will fail the typeof check if (!val || typeof val !== 'object') { return false; } + + // Must have type and props to be a valid React element + if (!val.type || !val.props) { + return false; + } + + // Check if this is an Enzyme ShallowWrapper with Emotion props if (val.type && val.props && val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__) { + console.log(`[test-enzyme-emotion-serializer] Matched Emotion component with __EMOTION_TYPE_PLEASE_DO_NOT_USE__:`, val.type); + return true; + } + + // Also check for components with a css prop (function, object, or string) + // These are Emotion-styled components that need css prop normalization + // BUT skip if css is already the processed string "unknown styles" to avoid infinite recursion + if (val.type && val.props && val.props.css && val.props.css !== 'unknown styles') { + console.log(`[test-enzyme-emotion-serializer] Matched component with css prop:`, val.type, typeof val.props.css); return true; } @@ -38,7 +87,9 @@ module.exports = { const emotionType = props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__; // Simplify the css prop to match the old snapshot format - if (props.css && typeof props.css === 'object') { + // Handle css as object, function, or any truthy value + if (props.css) { + console.log(`[serialize-enzyme-emotion-serializer] Simplifying css prop (type: ${typeof props.css}):`, props.css); props.css = 'unknown styles'; } @@ -48,16 +99,30 @@ module.exports = { // Try to get the original component name from Emotion's internal type let componentName = null; if (emotionType) { + console.log( + `[serialize-enzyme-emotion-serializer] Extracting component name from:`, + emotionType + ); // If emotionType is a string (like 'div', 'span'), use it directly if (typeof emotionType === 'string') { + console.log(`[serialize-enzyme-emotion-serializer] emotionType is a string:`, emotionType); componentName = emotionType; } // Emotion wraps components, try to get the display name else if (emotionType.displayName) { + console.log( + `[serialize-enzyme-emotion-serializer] Found displayName:`, + emotionType.displayName + ); componentName = emotionType.displayName; } else if (emotionType.name) { + console.log(`[serialize-enzyme-emotion-serializer] Found name:`, emotionType.name); componentName = emotionType.name; } else if (typeof emotionType === 'function' && emotionType.render) { + console.log( + `[serialize-enzyme-emotion-serializer] Extracting from render function:`, + emotionType.render + ); componentName = emotionType.render.displayName || emotionType.render.name; } } From 924729284e8cbeb68c364b30112341987dc29a05 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 15 Jan 2026 16:48:48 -0700 Subject: [PATCH 03/13] remove comments from enzyme emotion serializer --- .../jest/setup/enzyme_emotion_serializer.js | 60 ++----------------- 1 file changed, 4 insertions(+), 56 deletions(-) diff --git a/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js b/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js index f93578d8f2959..b2ec6f6eb2293 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js +++ b/src/platform/packages/shared/kbn-test/src/jest/setup/enzyme_emotion_serializer.js @@ -17,64 +17,27 @@ * transforms them to match the expected format before enzyme-to-json processes them. */ -const util = require('util'); - module.exports = { test(val) { - // Check if this is a shallow-rendered Enzyme wrapper containing an Emotion component - // We need to check for the Enzyme wrapper structure and Emotion internals - - // DEEP INSPECTION: Log the actual structure of what we receive - try { - const valType = typeof val; - const isNull = val === null; - const isArray = Array.isArray(val); - - console.log(`[test-enzyme-emotion-serializer] ====== RECEIVED VALUE ======`); - console.log(`[test-enzyme-emotion-serializer] typeof: ${valType}, isNull: ${isNull}, isArray: ${isArray}`); - - if (valType === 'string' && val === '[object Object]') { - console.log(`[test-enzyme-emotion-serializer] ⚠️ STRING VALUE: "${val}" (this is a stringified object)`); - console.log(`[test-enzyme-emotion-serializer] Stack trace to see who stringified it:`); - console.trace(); - } else if (valType === 'object' && !isNull) { - // Show the actual object structure - console.log(`[test-enzyme-emotion-serializer] Object keys:`, Object.keys(val)); - console.log(`[test-enzyme-emotion-serializer] Object.type:`, val.type); - console.log(`[test-enzyme-emotion-serializer] Object.props keys:`, val.props ? Object.keys(val.props) : 'no props'); - - // Deep inspect with util - console.log(`[test-enzyme-emotion-serializer] Full structure:`, util.inspect(val, { depth: 2, colors: false })); - } - console.log(`[test-enzyme-emotion-serializer] ====== END RECEIVED VALUE ======`); - } catch (e) { - console.log(`[test-enzyme-emotion-serializer] Error inspecting value:`, e.message); - } - - // Quick checks for invalid values - // Note: Stringified objects like "[object Object]" will fail the typeof check + // Skip if not an object if (!val || typeof val !== 'object') { return false; } - + // Must have type and props to be a valid React element if (!val.type || !val.props) { return false; } - - // Check if this is an Enzyme ShallowWrapper with Emotion props - if (val.type && val.props && val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__) { - console.log(`[test-enzyme-emotion-serializer] Matched Emotion component with __EMOTION_TYPE_PLEASE_DO_NOT_USE__:`, val.type); + if (val.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__) { return true; } // Also check for components with a css prop (function, object, or string) // These are Emotion-styled components that need css prop normalization // BUT skip if css is already the processed string "unknown styles" to avoid infinite recursion - if (val.type && val.props && val.props.css && val.props.css !== 'unknown styles') { - console.log(`[test-enzyme-emotion-serializer] Matched component with css prop:`, val.type, typeof val.props.css); + if (val.props.css && val.props.css !== 'unknown styles') { return true; } @@ -89,7 +52,6 @@ module.exports = { // Simplify the css prop to match the old snapshot format // Handle css as object, function, or any truthy value if (props.css) { - console.log(`[serialize-enzyme-emotion-serializer] Simplifying css prop (type: ${typeof props.css}):`, props.css); props.css = 'unknown styles'; } @@ -99,30 +61,16 @@ module.exports = { // Try to get the original component name from Emotion's internal type let componentName = null; if (emotionType) { - console.log( - `[serialize-enzyme-emotion-serializer] Extracting component name from:`, - emotionType - ); // If emotionType is a string (like 'div', 'span'), use it directly if (typeof emotionType === 'string') { - console.log(`[serialize-enzyme-emotion-serializer] emotionType is a string:`, emotionType); componentName = emotionType; } // Emotion wraps components, try to get the display name else if (emotionType.displayName) { - console.log( - `[serialize-enzyme-emotion-serializer] Found displayName:`, - emotionType.displayName - ); componentName = emotionType.displayName; } else if (emotionType.name) { - console.log(`[serialize-enzyme-emotion-serializer] Found name:`, emotionType.name); componentName = emotionType.name; } else if (typeof emotionType === 'function' && emotionType.render) { - console.log( - `[serialize-enzyme-emotion-serializer] Extracting from render function:`, - emotionType.render - ); componentName = emotionType.render.displayName || emotionType.render.name; } } From 77a4fdc322363465c7b458b659516aef2ebe8152 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 15 Jan 2026 16:49:11 -0700 Subject: [PATCH 04/13] set EMOTION_RUNTIME_AUTO_LABEL to true for dev runtime --- src/core/packages/root/browser-internal/src/kbn_bootstrap.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/packages/root/browser-internal/src/kbn_bootstrap.ts b/src/core/packages/root/browser-internal/src/kbn_bootstrap.ts index a06abd107fd06..8d42663981d3e 100644 --- a/src/core/packages/root/browser-internal/src/kbn_bootstrap.ts +++ b/src/core/packages/root/browser-internal/src/kbn_bootstrap.ts @@ -15,6 +15,10 @@ import { ApmSystem } from './apm_system'; import { LOAD_BOOTSTRAP_START } from './events'; +// Enable Emotion runtime auto-labeling for browser debugging in development +// This must be set before any Emotion code runs to enable readable class names in DevTools. +(globalThis as any).EMOTION_RUNTIME_AUTO_LABEL = true; + /** @internal */ export async function __kbnBootstrap__() { performance.mark(KBN_LOAD_MARKS, { From 86675df448121e5976da62db48faa365e8f648a3 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Fri, 16 Jan 2026 09:37:10 -0700 Subject: [PATCH 05/13] Enable Emotion runtime labeling in Jest to reduce snapshot failures After Emotion 11.12+ upgrade, component labels were lost from test snapshots, causing widespread CI failures. This commit enables runtime labeling (derive component names from stack traces to add to the CSS) in Jest by forcing Jest to use the development build of Emotion. - Custom Jest resolver forces @emotion/react development builds - Enable EMOTION_RUNTIME_AUTO_LABEL flag in test setup - Disable Babel autoLabel (conflicts with runtime labeling). If we used Babel's autoLabel, the best we can get would be variable names, which doesn't help when styles are inline and there is no variable - Use a custom Enzyme serializer for Emotion 11.12+ internal changes (added in a previous commit) - Manually run `src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx` to ensure the test passes with a snapshot that contains the component name (`-BannerItem`) --- .../browser-internal/src/banners/banners_list.test.tsx | 3 ++- .../packages/shared/kbn-test/src/jest/resolver.js | 9 +++++++++ .../shared/kbn-test/src/jest/setup/polyfills.jsdom.js | 4 ++++ .../src/jest/transforms/babel/transformer_config.js | 7 +++++-- .../plugins/shared/unified_search/public/use_memo_css.ts | 1 - 5 files changed, 20 insertions(+), 4 deletions(-) delete mode 100644 src/platform/plugins/shared/unified_search/public/use_memo_css.ts diff --git a/src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx b/src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx index b12194688a67b..01d07cdea3122 100644 --- a/src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx +++ b/src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx @@ -42,6 +42,7 @@ describe('BannersList', () => { ); + // The Jest-loaded dev build of Emotion has runtime labeling to add the component name from stack trace expect(container.innerHTML).toMatchInlineSnapshot( `"

Hello!

"` ); @@ -90,7 +91,7 @@ describe('BannersList', () => { expect(container.innerHTML).toContain('First Banner!'); }); - // Two new banners should be rendered + // Two new banners should be rendered (runtime labeling adds component name from the stack trace) expect(container.innerHTML).toMatchInlineSnapshot( `"

First Banner!

Second banner!

"` ); diff --git a/src/platform/packages/shared/kbn-test/src/jest/resolver.js b/src/platform/packages/shared/kbn-test/src/jest/resolver.js index 42acf38d2fe39..5ed396b7f4b32 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/resolver.js +++ b/src/platform/packages/shared/kbn-test/src/jest/resolver.js @@ -48,6 +48,15 @@ function parseRequestOrExtSuffix(str) { * @returns */ module.exports = (request, options) => { + // Force Emotion to load development builds for runtime labeling in tests + // This allows EMOTION_RUNTIME_AUTO_LABEL support + if (request === '@emotion/react') { + return resolve.sync('@emotion/react/dist/emotion-react.development.cjs.js', { + basedir: options.basedir, + extensions: options.extensions, + }); + } + if (request === `@elastic/eui`) { return module.exports(`@elastic/eui/test-env`, options); } diff --git a/src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js b/src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js index 8b33d4a2413d6..5549fcbbcb2e1 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js +++ b/src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js @@ -7,6 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +// Use dev build of Emotion to enable runtime labeling +// eslint-disable-next-line no-undef +globalThis.EMOTION_RUNTIME_AUTO_LABEL = true; + const MutationObserver = require('mutation-observer'); Object.defineProperty(window, 'MutationObserver', { value: MutationObserver }); diff --git a/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/transformer_config.js b/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/transformer_config.js index 8b275b37710f8..f0dd6d86d4dbb 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/transformer_config.js +++ b/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/transformer_config.js @@ -27,8 +27,11 @@ module.exports = () => ({ [ require.resolve('@emotion/babel-preset-css-prop'), { - autoLabel: 'always', - labelFormat: '[local]', + // Runtime labeling is enabled via custom Jest resolver which loads the development builds of Emotion + // Babel labeling is disabled here to avoid conflicting with Emotion + // This is required because Emotion will skip labeling if Babel already added a label with '-' in it + // See: Custom resolver forcing @emotion/react/dist/emotion-react.development.cjs.js + autoLabel: 'never', sourceMap: false, }, ], diff --git a/src/platform/plugins/shared/unified_search/public/use_memo_css.ts b/src/platform/plugins/shared/unified_search/public/use_memo_css.ts deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/src/platform/plugins/shared/unified_search/public/use_memo_css.ts +++ /dev/null @@ -1 +0,0 @@ - From fe5404caa55d02af04ac4285434d366c9535ac32 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Tue, 20 Jan 2026 14:56:09 -0700 Subject: [PATCH 06/13] switch to Babel's compile-time labeling --- .../browser-internal/src/banners/banners_list.test.tsx | 3 +-- .../packages/root/browser-internal/src/kbn_bootstrap.ts | 4 ---- .../packages/shared/kbn-test/src/jest/resolver.js | 9 --------- .../shared/kbn-test/src/jest/setup/polyfills.jsdom.js | 4 ---- .../src/jest/transforms/babel/transformer_config.js | 9 ++++----- 5 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx b/src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx index 01d07cdea3122..b12194688a67b 100644 --- a/src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx +++ b/src/core/packages/overlays/browser-internal/src/banners/banners_list.test.tsx @@ -42,7 +42,6 @@ describe('BannersList', () => { ); - // The Jest-loaded dev build of Emotion has runtime labeling to add the component name from stack trace expect(container.innerHTML).toMatchInlineSnapshot( `"

Hello!

"` ); @@ -91,7 +90,7 @@ describe('BannersList', () => { expect(container.innerHTML).toContain('First Banner!'); }); - // Two new banners should be rendered (runtime labeling adds component name from the stack trace) + // Two new banners should be rendered expect(container.innerHTML).toMatchInlineSnapshot( `"

First Banner!

Second banner!

"` ); diff --git a/src/core/packages/root/browser-internal/src/kbn_bootstrap.ts b/src/core/packages/root/browser-internal/src/kbn_bootstrap.ts index 8d42663981d3e..a06abd107fd06 100644 --- a/src/core/packages/root/browser-internal/src/kbn_bootstrap.ts +++ b/src/core/packages/root/browser-internal/src/kbn_bootstrap.ts @@ -15,10 +15,6 @@ import { ApmSystem } from './apm_system'; import { LOAD_BOOTSTRAP_START } from './events'; -// Enable Emotion runtime auto-labeling for browser debugging in development -// This must be set before any Emotion code runs to enable readable class names in DevTools. -(globalThis as any).EMOTION_RUNTIME_AUTO_LABEL = true; - /** @internal */ export async function __kbnBootstrap__() { performance.mark(KBN_LOAD_MARKS, { diff --git a/src/platform/packages/shared/kbn-test/src/jest/resolver.js b/src/platform/packages/shared/kbn-test/src/jest/resolver.js index 5ed396b7f4b32..42acf38d2fe39 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/resolver.js +++ b/src/platform/packages/shared/kbn-test/src/jest/resolver.js @@ -48,15 +48,6 @@ function parseRequestOrExtSuffix(str) { * @returns */ module.exports = (request, options) => { - // Force Emotion to load development builds for runtime labeling in tests - // This allows EMOTION_RUNTIME_AUTO_LABEL support - if (request === '@emotion/react') { - return resolve.sync('@emotion/react/dist/emotion-react.development.cjs.js', { - basedir: options.basedir, - extensions: options.extensions, - }); - } - if (request === `@elastic/eui`) { return module.exports(`@elastic/eui/test-env`, options); } diff --git a/src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js b/src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js index 5549fcbbcb2e1..8b33d4a2413d6 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js +++ b/src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js @@ -7,10 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -// Use dev build of Emotion to enable runtime labeling -// eslint-disable-next-line no-undef -globalThis.EMOTION_RUNTIME_AUTO_LABEL = true; - const MutationObserver = require('mutation-observer'); Object.defineProperty(window, 'MutationObserver', { value: MutationObserver }); diff --git a/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/transformer_config.js b/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/transformer_config.js index f0dd6d86d4dbb..7582528cb8b99 100644 --- a/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/transformer_config.js +++ b/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/transformer_config.js @@ -27,11 +27,10 @@ module.exports = () => ({ [ require.resolve('@emotion/babel-preset-css-prop'), { - // Runtime labeling is enabled via custom Jest resolver which loads the development builds of Emotion - // Babel labeling is disabled here to avoid conflicting with Emotion - // This is required because Emotion will skip labeling if Babel already added a label with '-' in it - // See: Custom resolver forcing @emotion/react/dist/emotion-react.development.cjs.js - autoLabel: 'never', + // Use Babel's compile-time labeling for better test performance + // This is preferred over Emotion's runtime labeling via stack traces because of performance + autoLabel: 'always', + labelFormat: '[local]', sourceMap: false, }, ], From 519f13636211663daeb0bf87be3f8a47dcc05f4a Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Tue, 20 Jan 2026 22:18:48 -0700 Subject: [PATCH 07/13] update snapshots --- .../loading_indicator.test.tsx.snap | 6 +- .../collapsible_nav.test.tsx.snap | 46 +-- .../__snapshots__/both_modes.test.tsx.snap | 8 +- .../collapsed_mode.test.tsx.snap | 12 +- .../__snapshots__/expanded_mode.test.tsx.snap | 8 +- .../src/banners/banners_list.test.tsx | 4 +- .../use_comparison_css.test.ts.snap | 18 -- .../add_from_library.test.tsx.snap | 2 +- .../toolbar_button.test.tsx.snap | 8 +- .../__snapshots__/popover.test.tsx.snap | 2 +- .../__snapshots__/toolbar.test.tsx.snap | 2 +- .../__snapshots__/solution_nav.test.tsx.snap | 24 +- .../__snapshots__/agg.test.tsx.snap | 2 +- .../__snapshots__/agg_group.test.tsx.snap | 2 +- .../markdown_options.test.tsx.snap | 2 +- .../value_axes_panel.test.tsx.snap | 4 +- .../value_axis_options.test.tsx.snap | 2 +- .../with_auto_scale.test.tsx.snap | 7 +- .../url/__snapshots__/url.test.tsx.snap | 4 +- .../solution_panel.test.tsx.snap | 37 +-- .../__snapshots__/markdown.test.tsx.snap | 10 +- .../not_found_errors.test.tsx.snap | 8 +- .../graph_visualization.test.tsx.snap | 219 ++++++++++---- .../graph_visualization.test.tsx | 2 +- .../venn_diagram/venn_diagram.test.tsx | 8 +- .../extend_index_management.test.tsx.snap | 8 +- .../__snapshots__/shard.test.js.snap | 12 +- .../__snapshots__/statement.test.js.snap | 8 +- .../__snapshots__/exporters.test.js.snap | 6 +- .../__snapshots__/reason_found.test.js.snap | 6 +- .../__snapshots__/index.test.js.snap | 48 +++- .../__snapshots__/index.test.tsx.snap | 18 +- .../request_trial_extension.test.tsx.snap | 8 +- .../revert_to_basic.test.tsx.snap | 6 +- .../__snapshots__/start_trial.test.tsx.snap | 8 +- .../__snapshots__/scale_control.test.tsx.snap | 28 +- .../feature_properties.test.tsx.snap | 267 +++++++++--------- .../list/__snapshots__/header.test.js.snap | 2 +- .../list/__snapshots__/header.test.js.snap | 2 +- .../components/rule_details.test.tsx | 29 +- 40 files changed, 502 insertions(+), 401 deletions(-) diff --git a/src/core/packages/chrome/browser-internal/src/ui/__snapshots__/loading_indicator.test.tsx.snap b/src/core/packages/chrome/browser-internal/src/ui/__snapshots__/loading_indicator.test.tsx.snap index 8f1a4d60c0538..9d2034867b6da 100644 --- a/src/core/packages/chrome/browser-internal/src/ui/__snapshots__/loading_indicator.test.tsx.snap +++ b/src/core/packages/chrome/browser-internal/src/ui/__snapshots__/loading_indicator.test.tsx.snap @@ -2,7 +2,7 @@ exports[`kbnLoadingIndicator is hidden by default 1`] = ` -