mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
# Backport This will backport the following commits from `main` to `8.x`: - [[jest] @emotion/babel-preset-css-prop (#216489)](https://github.com/elastic/kibana/pull/216489) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2025-04-14T12:29:47Z","message":"[jest] @emotion/babel-preset-css-prop (#216489)\n\n## Summary\n\nPartially address https://github.com/elastic/kibana/issues/216459\n\nThis PR adds `@emotion/babel-preset-css-prop` to jest config to improve\njest and emotion integration. There are some tradeoffs: this is a better\nsetup for emotion + testing library, but there are some seemingly\nregressions for enzyme. We think these are right tradeoffs to make,\nsince we optimize for emotion+testing library.\n\n### Main upsides are 😄 \n\n#### 🟢 Fixes snapshots with css prop\n\n`You have tried to stringify object returned from \\`css\\` function. It\nisn't supposed to be used directly (e.g. as value of the \\`className\\`\nprop), but rather handed to emotion so it can handle it (e.g. as value\nof \\`css\\` prop).` is replaced with proper emotion css classname.\n\n\n\n#### 🟢 We will be able to use jest style matchers for emotion\n`toHaveStyleRule`\n\nhttps://emotion.sh/docs/@emotion/jest#tohavestylerule\n\n_they can be used locally now, but we plan to follow up with global\nextend_\n\n### Considerations 🫤 \n\n#### 🟡 jsx doesn't work inside jest.mock function \n\nExample: \n\n```\njest.mock('./components/alert_header_title', () => ({\n > 27 | AlertHeaderTitle: jest.fn().mockReturnValue(<div></div>), \n | ^\n 28 | }));\n```\n\nFails with an error. `can't read jsx of undefined`. \n\nThis is because babel compiles this into: \n\n```\nimport { jsx as ___EmotionJSX } from '@emotion/react'\n\njest.mock('./components/alert_header_title', () => ({\n > 27 | AlertHeaderTitle: jest.fn().mockReturnValue(___EmotionJSX.jsx(….)), \n | ^\n 28 | }));\n```\n\nAnd, apparently, due to how jest imports work, __EmotionJSX is not yet\nin the scope.\n\nThe applied workaround is to rewrite to: \n\n```\njest.mock('./components/alert_header_title', () => ({\n AlertHeaderTitle: jest.fn(() => <div></div>), \n }));\n```\n\n\n#### 🟡 euiTheme needs to be available when euiTheme is accessed inside\n`css` function\n\nExample: \n\n```\nDashboardGrid removes panel when removed from container\n TypeError: Cannot read properties of undefined (reading 'size')\n 42 | margin: '-2px',\n 43 | position: 'absolute',\n > 44 | width: euiTheme.size.l,\n```\n\nThe fix was to wrap failing tests with `<EuiProvider/>` \n\n### Drawbacks 😢 \n\nMostly related to Enzyme \n\n#### 🔴 Enzyme shallow snapshot no longer include `css` prop \n\nSince `css` prop is compiled away there are bunch of snapshots that\nlooks like a regression:\n\nExample:\n\n\n\nThis is unfortunate. We've tried `@emotion/jest/enzyme-serializer` but\nit didn't work (likely because enzyme ecosystem no longer supported?)\nIf it is important that the snapshot captures css, we recommend to use\nmount or rtl\n\n#### 🔴 Asserting against `css` prop with shallow render also doesn't\nwork\n\nPossible solution is to use \n\n```\nimport { matchers } from '@emotion/jest';\nexpect.extend(matchers);\n```\n\n(We plan to add these matches globally in a follow up)\n\nand \n\n```\n expect(button).toHaveStyleRule('background-color', '#FFFFFF');\n```\n\n\n\n#### 🔴 Some shallow Enzyme tests `find()` breaks because of code\ntransformations of emotion\n\nExample:\n\n```\nconst component = shallow(\n <MetricVisValue />\n)\n\ncomponent.find('button') // fails because instead of <button/> there is <EmotionInternalCss/> element now \n\n```\n\nSolutions:\n- Use full mount or react testing library \n- Or target by data-test-subj\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>","sha":"ef0322d8d05be4a2a02b16133a5f8488fe506900","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:ExpressionLanguage","release_note:skip","ci:skip-cypress-osquery","Team:obs-ux-infra_services","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0"],"title":"[jest] @emotion/babel-preset-css-prop","number":216489,"url":"https://github.com/elastic/kibana/pull/216489","mergeCommit":{"message":"[jest] @emotion/babel-preset-css-prop (#216489)\n\n## Summary\n\nPartially address https://github.com/elastic/kibana/issues/216459\n\nThis PR adds `@emotion/babel-preset-css-prop` to jest config to improve\njest and emotion integration. There are some tradeoffs: this is a better\nsetup for emotion + testing library, but there are some seemingly\nregressions for enzyme. We think these are right tradeoffs to make,\nsince we optimize for emotion+testing library.\n\n### Main upsides are 😄 \n\n#### 🟢 Fixes snapshots with css prop\n\n`You have tried to stringify object returned from \\`css\\` function. It\nisn't supposed to be used directly (e.g. as value of the \\`className\\`\nprop), but rather handed to emotion so it can handle it (e.g. as value\nof \\`css\\` prop).` is replaced with proper emotion css classname.\n\n\n\n#### 🟢 We will be able to use jest style matchers for emotion\n`toHaveStyleRule`\n\nhttps://emotion.sh/docs/@emotion/jest#tohavestylerule\n\n_they can be used locally now, but we plan to follow up with global\nextend_\n\n### Considerations 🫤 \n\n#### 🟡 jsx doesn't work inside jest.mock function \n\nExample: \n\n```\njest.mock('./components/alert_header_title', () => ({\n > 27 | AlertHeaderTitle: jest.fn().mockReturnValue(<div></div>), \n | ^\n 28 | }));\n```\n\nFails with an error. `can't read jsx of undefined`. \n\nThis is because babel compiles this into: \n\n```\nimport { jsx as ___EmotionJSX } from '@emotion/react'\n\njest.mock('./components/alert_header_title', () => ({\n > 27 | AlertHeaderTitle: jest.fn().mockReturnValue(___EmotionJSX.jsx(….)), \n | ^\n 28 | }));\n```\n\nAnd, apparently, due to how jest imports work, __EmotionJSX is not yet\nin the scope.\n\nThe applied workaround is to rewrite to: \n\n```\njest.mock('./components/alert_header_title', () => ({\n AlertHeaderTitle: jest.fn(() => <div></div>), \n }));\n```\n\n\n#### 🟡 euiTheme needs to be available when euiTheme is accessed inside\n`css` function\n\nExample: \n\n```\nDashboardGrid removes panel when removed from container\n TypeError: Cannot read properties of undefined (reading 'size')\n 42 | margin: '-2px',\n 43 | position: 'absolute',\n > 44 | width: euiTheme.size.l,\n```\n\nThe fix was to wrap failing tests with `<EuiProvider/>` \n\n### Drawbacks 😢 \n\nMostly related to Enzyme \n\n#### 🔴 Enzyme shallow snapshot no longer include `css` prop \n\nSince `css` prop is compiled away there are bunch of snapshots that\nlooks like a regression:\n\nExample:\n\n\n\nThis is unfortunate. We've tried `@emotion/jest/enzyme-serializer` but\nit didn't work (likely because enzyme ecosystem no longer supported?)\nIf it is important that the snapshot captures css, we recommend to use\nmount or rtl\n\n#### 🔴 Asserting against `css` prop with shallow render also doesn't\nwork\n\nPossible solution is to use \n\n```\nimport { matchers } from '@emotion/jest';\nexpect.extend(matchers);\n```\n\n(We plan to add these matches globally in a follow up)\n\nand \n\n```\n expect(button).toHaveStyleRule('background-color', '#FFFFFF');\n```\n\n\n\n#### 🔴 Some shallow Enzyme tests `find()` breaks because of code\ntransformations of emotion\n\nExample:\n\n```\nconst component = shallow(\n <MetricVisValue />\n)\n\ncomponent.find('button') // fails because instead of <button/> there is <EmotionInternalCss/> element now \n\n```\n\nSolutions:\n- Use full mount or react testing library \n- Or target by data-test-subj\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>","sha":"ef0322d8d05be4a2a02b16133a5f8488fe506900"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216489","number":216489,"mergeCommit":{"message":"[jest] @emotion/babel-preset-css-prop (#216489)\n\n## Summary\n\nPartially address https://github.com/elastic/kibana/issues/216459\n\nThis PR adds `@emotion/babel-preset-css-prop` to jest config to improve\njest and emotion integration. There are some tradeoffs: this is a better\nsetup for emotion + testing library, but there are some seemingly\nregressions for enzyme. We think these are right tradeoffs to make,\nsince we optimize for emotion+testing library.\n\n### Main upsides are 😄 \n\n#### 🟢 Fixes snapshots with css prop\n\n`You have tried to stringify object returned from \\`css\\` function. It\nisn't supposed to be used directly (e.g. as value of the \\`className\\`\nprop), but rather handed to emotion so it can handle it (e.g. as value\nof \\`css\\` prop).` is replaced with proper emotion css classname.\n\n\n\n#### 🟢 We will be able to use jest style matchers for emotion\n`toHaveStyleRule`\n\nhttps://emotion.sh/docs/@emotion/jest#tohavestylerule\n\n_they can be used locally now, but we plan to follow up with global\nextend_\n\n### Considerations 🫤 \n\n#### 🟡 jsx doesn't work inside jest.mock function \n\nExample: \n\n```\njest.mock('./components/alert_header_title', () => ({\n > 27 | AlertHeaderTitle: jest.fn().mockReturnValue(<div></div>), \n | ^\n 28 | }));\n```\n\nFails with an error. `can't read jsx of undefined`. \n\nThis is because babel compiles this into: \n\n```\nimport { jsx as ___EmotionJSX } from '@emotion/react'\n\njest.mock('./components/alert_header_title', () => ({\n > 27 | AlertHeaderTitle: jest.fn().mockReturnValue(___EmotionJSX.jsx(….)), \n | ^\n 28 | }));\n```\n\nAnd, apparently, due to how jest imports work, __EmotionJSX is not yet\nin the scope.\n\nThe applied workaround is to rewrite to: \n\n```\njest.mock('./components/alert_header_title', () => ({\n AlertHeaderTitle: jest.fn(() => <div></div>), \n }));\n```\n\n\n#### 🟡 euiTheme needs to be available when euiTheme is accessed inside\n`css` function\n\nExample: \n\n```\nDashboardGrid removes panel when removed from container\n TypeError: Cannot read properties of undefined (reading 'size')\n 42 | margin: '-2px',\n 43 | position: 'absolute',\n > 44 | width: euiTheme.size.l,\n```\n\nThe fix was to wrap failing tests with `<EuiProvider/>` \n\n### Drawbacks 😢 \n\nMostly related to Enzyme \n\n#### 🔴 Enzyme shallow snapshot no longer include `css` prop \n\nSince `css` prop is compiled away there are bunch of snapshots that\nlooks like a regression:\n\nExample:\n\n\n\nThis is unfortunate. We've tried `@emotion/jest/enzyme-serializer` but\nit didn't work (likely because enzyme ecosystem no longer supported?)\nIf it is important that the snapshot captures css, we recommend to use\nmount or rtl\n\n#### 🔴 Asserting against `css` prop with shallow render also doesn't\nwork\n\nPossible solution is to use \n\n```\nimport { matchers } from '@emotion/jest';\nexpect.extend(matchers);\n```\n\n(We plan to add these matches globally in a follow up)\n\nand \n\n```\n expect(button).toHaveStyleRule('background-color', '#FFFFFF');\n```\n\n\n\n#### 🔴 Some shallow Enzyme tests `find()` breaks because of code\ntransformations of emotion\n\nExample:\n\n```\nconst component = shallow(\n <MetricVisValue />\n)\n\ncomponent.find('button') // fails because instead of <button/> there is <EmotionInternalCss/> element now \n\n```\n\nSolutions:\n- Use full mount or react testing library \n- Or target by data-test-subj\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>","sha":"ef0322d8d05be4a2a02b16133a5f8488fe506900"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
This commit is contained in:
parent
f2d44152e7
commit
214787f501
152 changed files with 1777 additions and 3113 deletions
|
@ -5,9 +5,9 @@ exports[`kbnLoadingIndicator is hidden by default 1`] = `
|
|||
<EmotionGlobal
|
||||
styles={
|
||||
Object {
|
||||
".euiHeaderSectionItem .euiButtonEmpty__text": Object {
|
||||
"display": "flex",
|
||||
},
|
||||
"name": "11nwfnw-LoadingIndicator",
|
||||
"styles": ".euiHeaderSectionItem .euiButtonEmpty__text{display:flex;};label:LoadingIndicator;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
@ -25,9 +25,9 @@ exports[`kbnLoadingIndicator is visible when loadingCount is > 0 1`] = `
|
|||
<EmotionGlobal
|
||||
styles={
|
||||
Object {
|
||||
".euiHeaderSectionItem .euiButtonEmpty__text": Object {
|
||||
"display": "flex",
|
||||
},
|
||||
"name": "11nwfnw-LoadingIndicator",
|
||||
"styles": ".euiHeaderSectionItem .euiButtonEmpty__text{display:flex;};label:LoadingIndicator;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
@ -45,9 +45,9 @@ exports[`kbnLoadingIndicator shows logo image when customLogo is set 1`] = `
|
|||
<EmotionGlobal
|
||||
styles={
|
||||
Object {
|
||||
".euiHeaderSectionItem .euiButtonEmpty__text": Object {
|
||||
"display": "flex",
|
||||
},
|
||||
"name": "11nwfnw-LoadingIndicator",
|
||||
"styles": ".euiHeaderSectionItem .euiButtonEmpty__text{display:flex;};label:LoadingIndicator;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
|
|
@ -169,7 +169,7 @@ Array [
|
|||
>
|
||||
<ul
|
||||
aria-label="Recently viewed links"
|
||||
class="euiListGroup emotion-EuiListGroup"
|
||||
class="euiListGroup emotion-euiListGroup-none-navRecentsListGroupCss"
|
||||
style="max-inline-size: none;"
|
||||
>
|
||||
<li
|
||||
|
@ -219,10 +219,10 @@ Array [
|
|||
class="euiHorizontalRule emotion-euiHorizontalRule-full"
|
||||
/>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1-navSolutions"
|
||||
>
|
||||
<div
|
||||
class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup emotion-euiAccordion-EuiCollapsibleNavGroup"
|
||||
class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup emotion-euiAccordion-euiCollapsibleNavGroup-isCollapsible-none-navSolutionGroupButton"
|
||||
data-test-subj="collapsibleNavGroup-kibana"
|
||||
>
|
||||
<div
|
||||
|
@ -353,7 +353,7 @@ Array [
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup emotion-euiAccordion-EuiCollapsibleNavGroup"
|
||||
class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup emotion-euiAccordion-euiCollapsibleNavGroup-isCollapsible-none-navSolutionGroupButton"
|
||||
data-test-subj="collapsibleNavGroup-observability"
|
||||
>
|
||||
<div
|
||||
|
@ -467,7 +467,7 @@ Array [
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup emotion-euiAccordion-EuiCollapsibleNavGroup"
|
||||
class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup emotion-euiAccordion-euiCollapsibleNavGroup-isCollapsible-none-navSolutionGroupButton"
|
||||
data-test-subj="collapsibleNavGroup-securitySolution"
|
||||
>
|
||||
<div
|
||||
|
@ -564,7 +564,7 @@ Array [
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup emotion-euiAccordion-EuiCollapsibleNavGroup"
|
||||
class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup emotion-euiAccordion-euiCollapsibleNavGroup-isCollapsible-none-navSolutionGroupButton"
|
||||
data-test-subj="collapsibleNavGroup-management"
|
||||
>
|
||||
<div
|
||||
|
@ -863,15 +863,7 @@ exports[`CollapsibleNav renders the default nav 1`] = `
|
|||
<EuiCollapsibleNav
|
||||
aria-label="Primary"
|
||||
button={<button />}
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1pvcuvk",
|
||||
"next": undefined,
|
||||
"styles": "@media (max-height: 240px){overflow-y:auto;}",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="collapsibleNav"
|
||||
id="collapsibe-nav"
|
||||
isOpen={false}
|
||||
|
@ -879,13 +871,97 @@ exports[`CollapsibleNav renders the default nav 1`] = `
|
|||
ownFocus={false}
|
||||
size={248}
|
||||
>
|
||||
<button
|
||||
aria-controls="collapsibe-nav"
|
||||
aria-expanded={false}
|
||||
aria-pressed={false}
|
||||
onMouseUpCapture={[Function]}
|
||||
onTouchEnd={[Function]}
|
||||
<Insertion
|
||||
cache={
|
||||
Object {
|
||||
"insert": [Function],
|
||||
"inserted": Object {
|
||||
"1751mc5-navCss": true,
|
||||
},
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"registered": Object {
|
||||
"css-1751mc5-navCss": "@media (max-height: 240px){overflow-y:auto;};label:navCss;",
|
||||
},
|
||||
"sheet": StyleSheet {
|
||||
"_alreadyInsertedOrderInsensitiveRule": true,
|
||||
"_insertTag": [Function],
|
||||
"before": null,
|
||||
"container": <head>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-1751mc5-navCss{}
|
||||
</style>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
@media (max-height: 240px){.css-1751mc5-navCss{overflow-y:auto;}}
|
||||
</style>
|
||||
<style
|
||||
data-styled="active"
|
||||
data-styled-version="5.3.11"
|
||||
/>
|
||||
</head>,
|
||||
"ctr": 2,
|
||||
"insertionPoint": undefined,
|
||||
"isSpeedy": false,
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"prepend": undefined,
|
||||
"tags": Array [
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-1751mc5-navCss{}
|
||||
</style>,
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
@media (max-height: 240px){.css-1751mc5-navCss{overflow-y:auto;}}
|
||||
</style>,
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
isStringTag={false}
|
||||
serialized={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1751mc5-navCss",
|
||||
"next": undefined,
|
||||
"styles": "@media (max-height: 240px){overflow-y:auto;};label:navCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
<EuiCollapsibleNav
|
||||
aria-label="Primary"
|
||||
button={<button />}
|
||||
className="css-1751mc5-navCss"
|
||||
data-test-subj="collapsibleNav"
|
||||
id="collapsibe-nav"
|
||||
isOpen={false}
|
||||
onClose={[Function]}
|
||||
ownFocus={false}
|
||||
size={248}
|
||||
>
|
||||
<button
|
||||
aria-controls="collapsibe-nav"
|
||||
aria-expanded={false}
|
||||
aria-pressed={false}
|
||||
onMouseUpCapture={[Function]}
|
||||
onTouchEnd={[Function]}
|
||||
/>
|
||||
</EuiCollapsibleNav>
|
||||
</EuiCollapsibleNav>
|
||||
</CollapsibleNav>
|
||||
`;
|
||||
|
@ -1058,15 +1134,7 @@ exports[`CollapsibleNav renders the default nav 2`] = `
|
|||
<EuiCollapsibleNav
|
||||
aria-label="Primary"
|
||||
button={<button />}
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1pvcuvk",
|
||||
"next": undefined,
|
||||
"styles": "@media (max-height: 240px){overflow-y:auto;}",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="collapsibleNav"
|
||||
id="collapsibe-nav"
|
||||
isOpen={false}
|
||||
|
@ -1074,13 +1142,97 @@ exports[`CollapsibleNav renders the default nav 2`] = `
|
|||
ownFocus={false}
|
||||
size={248}
|
||||
>
|
||||
<button
|
||||
aria-controls="collapsibe-nav"
|
||||
aria-expanded={false}
|
||||
aria-pressed={false}
|
||||
onMouseUpCapture={[Function]}
|
||||
onTouchEnd={[Function]}
|
||||
<Insertion
|
||||
cache={
|
||||
Object {
|
||||
"insert": [Function],
|
||||
"inserted": Object {
|
||||
"1751mc5-navCss": true,
|
||||
},
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"registered": Object {
|
||||
"css-1751mc5-navCss": "@media (max-height: 240px){overflow-y:auto;};label:navCss;",
|
||||
},
|
||||
"sheet": StyleSheet {
|
||||
"_alreadyInsertedOrderInsensitiveRule": true,
|
||||
"_insertTag": [Function],
|
||||
"before": null,
|
||||
"container": <head>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-1751mc5-navCss{}
|
||||
</style>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
@media (max-height: 240px){.css-1751mc5-navCss{overflow-y:auto;}}
|
||||
</style>
|
||||
<style
|
||||
data-styled="active"
|
||||
data-styled-version="5.3.11"
|
||||
/>
|
||||
</head>,
|
||||
"ctr": 2,
|
||||
"insertionPoint": undefined,
|
||||
"isSpeedy": false,
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"prepend": undefined,
|
||||
"tags": Array [
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-1751mc5-navCss{}
|
||||
</style>,
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
@media (max-height: 240px){.css-1751mc5-navCss{overflow-y:auto;}}
|
||||
</style>,
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
isStringTag={false}
|
||||
serialized={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1751mc5-navCss",
|
||||
"next": undefined,
|
||||
"styles": "@media (max-height: 240px){overflow-y:auto;};label:navCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
<EuiCollapsibleNav
|
||||
aria-label="Primary"
|
||||
button={<button />}
|
||||
className="css-1751mc5-navCss"
|
||||
data-test-subj="collapsibleNav"
|
||||
id="collapsibe-nav"
|
||||
isOpen={false}
|
||||
onClose={[Function]}
|
||||
ownFocus={false}
|
||||
size={248}
|
||||
>
|
||||
<button
|
||||
aria-controls="collapsibe-nav"
|
||||
aria-expanded={false}
|
||||
aria-pressed={false}
|
||||
onMouseUpCapture={[Function]}
|
||||
onTouchEnd={[Function]}
|
||||
/>
|
||||
</EuiCollapsibleNav>
|
||||
</EuiCollapsibleNav>
|
||||
</CollapsibleNav>
|
||||
`;
|
||||
|
|
|
@ -56,7 +56,7 @@ Array [
|
|||
>
|
||||
<a
|
||||
aria-label="Elastic home"
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-4ghmd2-logoCss"
|
||||
data-test-subj="logo"
|
||||
href="/"
|
||||
>
|
||||
|
@ -69,7 +69,7 @@ Array [
|
|||
<svg
|
||||
aria-hidden="true"
|
||||
aria-labelledby="elasticMark"
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-1ks1hwq-logoMarkCss"
|
||||
data-test-subj="logoMark"
|
||||
fill="none"
|
||||
height="19"
|
||||
|
|
|
@ -5,7 +5,7 @@ exports[`TitleWithBadge component renders with string titles 1`] = `
|
|||
Welcome!
|
||||
|
||||
<EuiNotificationBadge
|
||||
className="css-1f5ny76"
|
||||
className="css-721pd1-floatTopRight"
|
||||
color="subdued"
|
||||
size="m"
|
||||
>
|
||||
|
|
|
@ -164,19 +164,25 @@ describe('GridLayout', () => {
|
|||
it('panel gets active when dragged', () => {
|
||||
renderGridLayout();
|
||||
const panelHandle = getPanelHandle('panel1');
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass('kbnGridPanel', {
|
||||
exact: true,
|
||||
});
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass(
|
||||
'kbnGridPanel css-c5ixg-initialStyles',
|
||||
{
|
||||
exact: true,
|
||||
}
|
||||
);
|
||||
mouseStartDragging(panelHandle);
|
||||
mouseMoveTo({ clientX: 256, clientY: 128 });
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass(
|
||||
'kbnGridPanel kbnGridPanel--active',
|
||||
'kbnGridPanel css-c5ixg-initialStyles kbnGridPanel--active',
|
||||
{ exact: true }
|
||||
);
|
||||
mouseDrop(panelHandle);
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass('kbnGridPanel', {
|
||||
exact: true,
|
||||
});
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass(
|
||||
'kbnGridPanel css-c5ixg-initialStyles',
|
||||
{
|
||||
exact: true,
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiThemeProvider } from '@elastic/eui';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { GridPanel, type GridPanelProps } from './grid_panel';
|
||||
import { getGridLayoutStateManagerMock, mockRenderPanelContents } from '../test_utils/mocks';
|
||||
|
@ -29,9 +30,11 @@ describe('GridPanel', () => {
|
|||
...(overrides?.propsOverrides ?? {}),
|
||||
};
|
||||
const { rerender, ...rtlRest } = render(
|
||||
<GridLayoutContext.Provider value={contextValue}>
|
||||
<GridPanel {...panelProps} />
|
||||
</GridLayoutContext.Provider>
|
||||
<EuiThemeProvider>
|
||||
<GridLayoutContext.Provider value={contextValue}>
|
||||
<GridPanel {...panelProps} />
|
||||
</GridLayoutContext.Provider>
|
||||
</EuiThemeProvider>
|
||||
);
|
||||
|
||||
return {
|
||||
|
@ -41,16 +44,18 @@ describe('GridPanel', () => {
|
|||
contextOverrides?: Partial<GridLayoutContextType>;
|
||||
}) => {
|
||||
return rerender(
|
||||
<GridLayoutContext.Provider
|
||||
value={
|
||||
{
|
||||
...contextValue,
|
||||
...(newOverrides?.contextOverrides ?? {}),
|
||||
} as GridLayoutContextType
|
||||
}
|
||||
>
|
||||
<GridPanel {...panelProps} {...(newOverrides?.propsOverrides ?? {})} />
|
||||
</GridLayoutContext.Provider>
|
||||
<EuiThemeProvider>
|
||||
<GridLayoutContext.Provider
|
||||
value={
|
||||
{
|
||||
...contextValue,
|
||||
...(newOverrides?.contextOverrides ?? {}),
|
||||
} as GridLayoutContextType
|
||||
}
|
||||
>
|
||||
<GridPanel {...panelProps} {...(newOverrides?.propsOverrides ?? {})} />
|
||||
</GridLayoutContext.Provider>
|
||||
</EuiThemeProvider>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
|
|
@ -60,39 +60,51 @@ describe('Keyboard navigation', () => {
|
|||
renderGridLayout();
|
||||
const panelHandle = getPanelHandle('panel1');
|
||||
panelHandle.focus();
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass('kbnGridPanel', {
|
||||
exact: true,
|
||||
});
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass(
|
||||
'kbnGridPanel css-c5ixg-initialStyles',
|
||||
{
|
||||
exact: true,
|
||||
}
|
||||
);
|
||||
await pressEnter();
|
||||
await pressKey('[ArrowDown]');
|
||||
expect(panelHandle).toHaveFocus(); // focus is not lost during interaction
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass(
|
||||
'kbnGridPanel kbnGridPanel--active',
|
||||
'kbnGridPanel kbnGridPanel--active css-c5ixg-initialStyles',
|
||||
{ exact: true }
|
||||
);
|
||||
await pressEnter();
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass('kbnGridPanel', {
|
||||
exact: true,
|
||||
});
|
||||
expect(screen.getByLabelText('panelId:panel1').closest('div')).toHaveClass(
|
||||
'kbnGridPanel css-c5ixg-initialStyles',
|
||||
{
|
||||
exact: true,
|
||||
}
|
||||
);
|
||||
});
|
||||
it('should show the panel active when during interaction for resize handle', async () => {
|
||||
renderGridLayout();
|
||||
const panelHandle = getPanelHandle('panel5', 'resize');
|
||||
panelHandle.focus();
|
||||
expect(screen.getByLabelText('panelId:panel5').closest('div')).toHaveClass('kbnGridPanel', {
|
||||
exact: true,
|
||||
});
|
||||
expect(screen.getByLabelText('panelId:panel5').closest('div')).toHaveClass(
|
||||
'kbnGridPanel css-1l7q1xe-initialStyles',
|
||||
{
|
||||
exact: true,
|
||||
}
|
||||
);
|
||||
await pressEnter();
|
||||
await pressKey('[ArrowDown]');
|
||||
expect(panelHandle).toHaveFocus(); // focus is not lost during interaction
|
||||
expect(screen.getByLabelText('panelId:panel5').closest('div')).toHaveClass(
|
||||
'kbnGridPanel kbnGridPanel--active',
|
||||
'kbnGridPanel css-1l7q1xe-initialStyles kbnGridPanel--active',
|
||||
{ exact: true }
|
||||
);
|
||||
await pressKey('{Escape}');
|
||||
expect(screen.getByLabelText('panelId:panel5').closest('div')).toHaveClass('kbnGridPanel', {
|
||||
exact: true,
|
||||
});
|
||||
expect(screen.getByLabelText('panelId:panel5').closest('div')).toHaveClass(
|
||||
'kbnGridPanel css-1l7q1xe-initialStyles',
|
||||
{
|
||||
exact: true,
|
||||
}
|
||||
);
|
||||
expect(panelHandle).toHaveFocus(); // focus is not lost during interaction
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,4 +20,19 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
exclude: require('@kbn/babel-preset/styled_components_files').USES_STYLED_COMPONENTS,
|
||||
presets: [
|
||||
[
|
||||
require.resolve('@emotion/babel-preset-css-prop'),
|
||||
{
|
||||
autoLabel: 'always',
|
||||
labelFormat: '[local]',
|
||||
sourceMap: false,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -40,5 +40,6 @@
|
|||
"@kbn/scout-reporting",
|
||||
"@kbn/scout-info",
|
||||
"@kbn/react-mute-legacy-root-warning",
|
||||
"@kbn/babel-preset",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -92,11 +92,11 @@ describe('CompareDocuments', () => {
|
|||
renderCompareDocuments();
|
||||
expect(mockDataGridProps).toBeDefined();
|
||||
expect(mockDataGridProps?.columns).toBeDefined();
|
||||
expect(mockDataGridProps?.css).toBeDefined();
|
||||
expect(omit(mockDataGridProps, 'columns', 'css')).toMatchInlineSnapshot(`
|
||||
expect(omit(mockDataGridProps, 'columns')).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"aria-describedby": "test",
|
||||
"aria-labelledby": "test",
|
||||
"className": "css-467ews-useComparisonCss-useComparisonCss",
|
||||
"columnVisibility": Object {
|
||||
"setVisibleColumns": [Function],
|
||||
"visibleColumns": Array [
|
||||
|
|
|
@ -3,59 +3,9 @@
|
|||
exports[`useComparisonCss should render with basic diff mode and diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1qc86qa",
|
||||
"name": "467ews-useComparisonCss-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonMatchCell {
|
||||
.unifiedDataTable__cellValue {
|
||||
&,
|
||||
& * {
|
||||
color: #007871 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonDiffCell {
|
||||
.unifiedDataTable__cellValue {
|
||||
&,
|
||||
& * {
|
||||
color: #bd271e !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);}.unifiedDataTable__comparisonMatchCell{.unifiedDataTable__cellValue{&,& *{color:#007871!important;}}}.unifiedDataTable__comparisonDiffCell{.unifiedDataTable__cellValue{&,& *{color:#bd271e!important;}}};label:useComparisonCss;; .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;} ;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
@ -63,59 +13,9 @@ Object {
|
|||
exports[`useComparisonCss should render with basic diff mode and no diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1qc86qa",
|
||||
"name": "467ews-useComparisonCss-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonMatchCell {
|
||||
.unifiedDataTable__cellValue {
|
||||
&,
|
||||
& * {
|
||||
color: #007871 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonDiffCell {
|
||||
.unifiedDataTable__cellValue {
|
||||
&,
|
||||
& * {
|
||||
color: #bd271e !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);}.unifiedDataTable__comparisonMatchCell{.unifiedDataTable__cellValue{&,& *{color:#007871!important;}}}.unifiedDataTable__comparisonDiffCell{.unifiedDataTable__cellValue{&,& *{color:#bd271e!important;}}};label:useComparisonCss;; .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;} ;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
@ -123,49 +23,9 @@ Object {
|
|||
exports[`useComparisonCss should render with chars diff mode and diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "vd39me",
|
||||
"name": "18srtms-useComparisonCss-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);} .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;}.unifiedDataTable__comparisonAddedSegment{text-decoration:underline;}.unifiedDataTable__comparisonRemovedSegment{text-decoration:line-through;};label:useComparisonCss;; ;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
@ -173,41 +33,9 @@ Object {
|
|||
exports[`useComparisonCss should render with chars diff mode and no diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1ylxgdl",
|
||||
"name": "1s4cihi-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);} .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;} ;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
@ -215,77 +43,9 @@ Object {
|
|||
exports[`useComparisonCss should render with lines diff mode and diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1nu19hw",
|
||||
"name": "1ltr1qk-indicatorCss-indicatorCss-useComparisonCss-useComparisonCss-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
padding-left: calc(4px / 2);
|
||||
}
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment:before {
|
||||
content: '+';
|
||||
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 100%;
|
||||
margin-left: calc(-8px - calc(4px / 2));
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
font-weight: 500;
|
||||
;
|
||||
background-color: #00BFB3;
|
||||
color: #F1F4FA;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment:before {
|
||||
content: '-';
|
||||
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 100%;
|
||||
margin-left: calc(-8px - calc(4px / 2));
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
font-weight: 500;
|
||||
;
|
||||
background-color: #BD271E;
|
||||
color: #F1F4FA;
|
||||
}
|
||||
;
|
||||
;
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);} .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;} .unifiedDataTable__comparisonSegment{padding-left:calc(4px / 2);}.unifiedDataTable__comparisonAddedSegment:before{content:'+';position:absolute;width:8px;height:100%;margin-left:calc(-8px - calc(4px / 2));text-align:center;line-height:1;font-weight:500;;label:indicatorCss;; background-color:#00BFB3;color:#F1F4FA;}.unifiedDataTable__comparisonRemovedSegment:before{content:'-';position:absolute;width:8px;height:100%;margin-left:calc(-8px - calc(4px / 2));text-align:center;line-height:1;font-weight:500;;label:indicatorCss;; background-color:#BD271E;color:#F1F4FA;};label:useComparisonCss;;;;label:useComparisonCss;;;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
@ -293,47 +53,9 @@ Object {
|
|||
exports[`useComparisonCss should render with lines diff mode and no diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1mthx0u",
|
||||
"name": "fzmg9i-useComparisonCss-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
padding-left: calc(4px / 2);
|
||||
}
|
||||
|
||||
|
||||
;
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);} .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;} .unifiedDataTable__comparisonSegment{padding-left:calc(4px / 2);};;label:useComparisonCss;;;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
@ -341,41 +63,9 @@ Object {
|
|||
exports[`useComparisonCss should render with no diff mode and no diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1ylxgdl",
|
||||
"name": "1s4cihi-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);} .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;} ;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
@ -383,49 +73,9 @@ Object {
|
|||
exports[`useComparisonCss should render with words diff mode and diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "vd39me",
|
||||
"name": "18srtms-useComparisonCss-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);} .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;}.unifiedDataTable__comparisonAddedSegment{text-decoration:underline;}.unifiedDataTable__comparisonRemovedSegment{text-decoration:line-through;};label:useComparisonCss;; ;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
@ -433,41 +83,9 @@ Object {
|
|||
exports[`useComparisonCss should render with words diff mode and no diff decorations 1`] = `
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1ylxgdl",
|
||||
"name": "1s4cihi-useComparisonCss",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
.unifiedDataTable__cellValue {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonFieldName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonBaseDocCell {
|
||||
background-color: rgba(211,218,230,0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.unifiedDataTable__comparisonSegment {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonAddedSegment {
|
||||
background-color: #e6f9f7;
|
||||
color: #007871;
|
||||
}
|
||||
|
||||
.unifiedDataTable__comparisonRemovedSegment {
|
||||
background-color: #f8e9e9;
|
||||
color: #bd271e;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
",
|
||||
"styles": ".unifiedDataTable__cellValue{white-space:pre-wrap;}.unifiedDataTable__comparisonFieldName{font-weight:600;}.unifiedDataTable__comparisonBaseDocCell{background-color:rgba(211,218,230,0.2);} .unifiedDataTable__comparisonSegment{position:relative;}.unifiedDataTable__comparisonAddedSegment{background-color:#e6f9f7;color:#007871;}.unifiedDataTable__comparisonRemovedSegment{background-color:#f8e9e9;color:#bd271e;} ;;label:useComparisonCss;",
|
||||
"toString": [Function],
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -35,7 +35,10 @@ describe('UnifiedFieldList <FieldTypeFilter />', () => {
|
|||
|
||||
async function toggleType(wrapper: ReactWrapper, fieldType: string) {
|
||||
act(() => {
|
||||
wrapper.find(`[data-test-subj="typeFilter-${fieldType}"]`).first().simulate('click');
|
||||
wrapper
|
||||
.find(`EuiContextMenuItem[data-test-subj="typeFilter-${fieldType}"]`)
|
||||
.first()
|
||||
.simulate('click');
|
||||
});
|
||||
|
||||
await wrapper.update();
|
||||
|
|
|
@ -372,7 +372,7 @@ describe('UnifiedFieldList FieldListGrouped + useGroupedFields()', () => {
|
|||
});
|
||||
|
||||
await act(async () => {
|
||||
await wrapper.find('[data-test-subj="typeFilter-date"]').first().simulate('click');
|
||||
await wrapper.find('button[data-test-subj="typeFilter-date"]').first().simulate('click');
|
||||
await wrapper.update();
|
||||
});
|
||||
|
||||
|
|
|
@ -17,17 +17,7 @@ describe('UnifiedFieldList <NoFieldCallout />', () => {
|
|||
expect(component).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
color="subdued"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1qdt3rt",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="noFieldsCallout-noFieldsExist"
|
||||
size="s"
|
||||
>
|
||||
|
@ -42,17 +32,7 @@ describe('UnifiedFieldList <NoFieldCallout />', () => {
|
|||
expect(component).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
color="subdued"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "wd14gj",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="noFieldsCallout-noFieldsMatch"
|
||||
size="s"
|
||||
>
|
||||
|
@ -69,17 +49,7 @@ describe('UnifiedFieldList <NoFieldCallout />', () => {
|
|||
expect(component).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
color="subdued"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "wd14gj",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="noFieldsCallout-noFieldsMatch"
|
||||
size="s"
|
||||
>
|
||||
|
@ -97,17 +67,7 @@ describe('UnifiedFieldList <NoFieldCallout />', () => {
|
|||
expect(component).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
color="subdued"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "wd14gj",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="noFieldsCallout-noFieldsMatch"
|
||||
size="s"
|
||||
>
|
||||
|
@ -138,17 +98,7 @@ describe('UnifiedFieldList <NoFieldCallout />', () => {
|
|||
expect(component).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
color="subdued"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "wd14gj",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="noFieldsCallout-noFieldsMatch"
|
||||
size="s"
|
||||
>
|
||||
|
@ -182,17 +132,7 @@ describe('UnifiedFieldList <NoFieldCallout />', () => {
|
|||
expect(component).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
color="subdued"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "wd14gj",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="noFieldsCallout-noFieldsMatch"
|
||||
size="s"
|
||||
>
|
||||
|
@ -227,17 +167,7 @@ describe('UnifiedFieldList <NoFieldCallout />', () => {
|
|||
expect(component).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
color="subdued"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "wd14gj",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="noFieldsCallout-noFieldsMatch"
|
||||
size="s"
|
||||
>
|
||||
|
|
|
@ -8,7 +8,13 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiButton, EuiText, EuiPopoverTitle, EuiPopoverFooter } from '@elastic/eui';
|
||||
import {
|
||||
EuiButton,
|
||||
EuiText,
|
||||
EuiPopoverTitle,
|
||||
EuiPopoverFooter,
|
||||
EuiThemeProvider,
|
||||
} from '@elastic/eui';
|
||||
import { mountWithIntl } from '@kbn/test-jest-helpers';
|
||||
import { stubLogstashDataView as dataView } from '@kbn/data-views-plugin/common/data_view.stub';
|
||||
import { FieldPopover } from './field_popover';
|
||||
|
@ -38,7 +44,8 @@ describe('UnifiedFieldList <FieldPopover />', () => {
|
|||
button={<EuiButton title="test" />}
|
||||
renderHeader={() => <EuiText>{'header'}</EuiText>}
|
||||
renderContent={() => <EuiText>{'content'}</EuiText>}
|
||||
/>
|
||||
/>,
|
||||
{ wrappingComponent: EuiThemeProvider }
|
||||
);
|
||||
|
||||
expect(wrapper.find(EuiText).first().text()).toBe('header');
|
||||
|
@ -78,7 +85,8 @@ describe('UnifiedFieldList <FieldPopover />', () => {
|
|||
/>
|
||||
)}
|
||||
renderContent={() => <EuiText>{'content'}</EuiText>}
|
||||
/>
|
||||
/>,
|
||||
{ wrappingComponent: EuiThemeProvider }
|
||||
);
|
||||
|
||||
expect(wrapper.find(EuiPopoverTitle).text()).toBe(fieldName);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { EuiButtonIcon, EuiPopover, EuiProgress } from '@elastic/eui';
|
||||
import { EuiButtonIcon, EuiPopover, EuiProgress, EuiThemeProvider } from '@elastic/eui';
|
||||
import React from 'react';
|
||||
import { findTestSubject } from '@elastic/eui/lib/test';
|
||||
import { mountWithIntl } from '@kbn/test-jest-helpers';
|
||||
|
@ -89,7 +89,11 @@ async function getComponent({
|
|||
size: 'xs',
|
||||
workspaceSelectedFieldNames: [],
|
||||
};
|
||||
const comp = await mountWithIntl(<UnifiedFieldListItem {...props} />);
|
||||
const comp = await mountWithIntl(
|
||||
<EuiThemeProvider>
|
||||
<UnifiedFieldListItem {...props} />
|
||||
</EuiThemeProvider>
|
||||
);
|
||||
// wait for lazy modules
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
await comp.update();
|
||||
|
|
|
@ -18,7 +18,7 @@ import { mockRenderContext } from '../mocks/context.mock';
|
|||
|
||||
const props = createPartialObjectMock<EuiDataGridCellPopoverElementProps>({
|
||||
rowIndex: 0,
|
||||
DefaultCellPopover: jest.fn().mockReturnValue(<div data-test-subj="defaultCellPopover" />),
|
||||
DefaultCellPopover: jest.fn(() => <div data-test-subj="defaultCellPopover" />),
|
||||
});
|
||||
|
||||
describe('CellPopoverHost', () => {
|
||||
|
|
|
@ -9,14 +9,7 @@ exports[`<ExitFullScreenButton /> with kibana services is rendered 1`] = `
|
|||
In full screen mode, press ESC to exit.
|
||||
</p>
|
||||
<button
|
||||
class="exitFullScreenButton"
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop).,You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop).,
|
||||
box-shadow:
|
||||
0 1px 5px rgba(0,0,0,0.1),
|
||||
0 3.6px 13px rgba(0,0,0,0.07),
|
||||
0 8.4px 23px rgba(0,0,0,0.06),
|
||||
0 23px 35px rgba(0,0,0,0.05);
|
||||
,You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="exitFullScreenButton emotion-euiButtonDisplay-buttonCSS-buttonCSS"
|
||||
data-test-subj="exitFullScreenModeButton"
|
||||
>
|
||||
<span
|
||||
|
@ -56,14 +49,7 @@ exports[`<ExitFullScreenButton /> with kibana services renders custom logo 1`] =
|
|||
In full screen mode, press ESC to exit.
|
||||
</p>
|
||||
<button
|
||||
class="exitFullScreenButton"
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop).,You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop).,
|
||||
box-shadow:
|
||||
0 1px 5px rgba(0,0,0,0.1),
|
||||
0 3.6px 13px rgba(0,0,0,0.07),
|
||||
0 8.4px 23px rgba(0,0,0,0.06),
|
||||
0 23px 35px rgba(0,0,0,0.05);
|
||||
,You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="exitFullScreenButton emotion-euiButtonDisplay-buttonCSS-buttonCSS"
|
||||
data-test-subj="exitFullScreenModeButton"
|
||||
>
|
||||
<span
|
||||
|
@ -110,14 +96,7 @@ exports[`<ExitFullScreenButton /> with manual services is rendered 1`] = `
|
|||
In full screen mode, press ESC to exit.
|
||||
</p>
|
||||
<button
|
||||
class="exitFullScreenButton"
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop).,You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop).,
|
||||
box-shadow:
|
||||
0 1px 5px rgba(0,0,0,0.1),
|
||||
0 3.6px 13px rgba(0,0,0,0.07),
|
||||
0 8.4px 23px rgba(0,0,0,0.06),
|
||||
0 23px 35px rgba(0,0,0,0.05);
|
||||
,You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="exitFullScreenButton emotion-euiButtonDisplay-buttonCSS-buttonCSS"
|
||||
data-test-subj="exitFullScreenModeButton"
|
||||
>
|
||||
<span
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`<AddFromLibraryButton /> is rendered 1`] = `
|
||||
<button
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-EuiButton"
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-base-text-ToolbarStandardButton"
|
||||
intl="[object Object]"
|
||||
type="button"
|
||||
>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`<IconButtonGroup /> is rendered 1`] = `
|
||||
<fieldset
|
||||
class="euiButtonGroup emotion-EuiButtonGroup"
|
||||
class="euiButtonGroup emotion-euiButtonGroup-IconButtonGroup"
|
||||
>
|
||||
<legend
|
||||
class="emotion-euiScreenReaderOnly"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
exports[`<ToolbarButton /> iconButton is rendered - default 1`] = `
|
||||
<button
|
||||
as="iconButton"
|
||||
class="euiButtonIcon emotion-EuiButtonIcon"
|
||||
class="euiButtonIcon emotion-euiButtonIcon-m-base-text-ToolbarIconButton"
|
||||
intl="[object Object]"
|
||||
type="button"
|
||||
>
|
||||
|
@ -18,7 +18,7 @@ exports[`<ToolbarButton /> iconButton is rendered - default 1`] = `
|
|||
|
||||
exports[`<ToolbarButton /> standard is rendered - default 1`] = `
|
||||
<button
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-EuiButton"
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-base-text-ToolbarStandardButton"
|
||||
intl="[object Object]"
|
||||
type="button"
|
||||
>
|
||||
|
@ -40,7 +40,7 @@ exports[`<ToolbarButton /> standard is rendered - default 1`] = `
|
|||
|
||||
exports[`<ToolbarButton /> standard is rendered - primary 1`] = `
|
||||
<button
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-EuiButton"
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-fill-primary-ToolbarStandardButton"
|
||||
intl="[object Object]"
|
||||
type="button"
|
||||
>
|
||||
|
@ -62,7 +62,7 @@ exports[`<ToolbarButton /> standard is rendered - primary 1`] = `
|
|||
|
||||
exports[`<ToolbarButton /> standard is rendered - text wth icon 1`] = `
|
||||
<button
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-EuiButton"
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-fill-primary-ToolbarStandardButton"
|
||||
intl="[object Object]"
|
||||
type="button"
|
||||
>
|
||||
|
|
|
@ -6,7 +6,7 @@ exports[`<ToolbarPopover /> is rendered 1`] = `
|
|||
intl="[object Object]"
|
||||
>
|
||||
<button
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-EuiButton"
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-base-text-ToolbarStandardButton"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
import React from 'react';
|
||||
import { mountWithIntl } from '@kbn/test-jest-helpers';
|
||||
import { matchers } from '@emotion/jest';
|
||||
expect.extend(matchers);
|
||||
|
||||
import { ToolbarPopover } from './popover';
|
||||
|
||||
|
@ -36,11 +38,9 @@ describe('<ToolbarPopover />', () => {
|
|||
const component = mountWithIntl(<ToolbarPopover label="test" children={() => !isOpen} />);
|
||||
const button = component.find('EuiButton');
|
||||
expect(button.prop('color')).toBe('text');
|
||||
expect(button.prop('css')).toMatchObject({
|
||||
backgroundColor: '#FFFFFF',
|
||||
border: '1px solid #D3DAE6',
|
||||
color: '#343741',
|
||||
});
|
||||
expect(button).toHaveStyleRule('background-color', '#FFFFFF');
|
||||
expect(button).toHaveStyleRule('border', '1px solid #D3DAE6');
|
||||
expect(button).toHaveStyleRule('color', '#343741');
|
||||
});
|
||||
|
||||
test('accepts a button type', () => {
|
||||
|
|
|
@ -8,7 +8,7 @@ exports[`<Toolbar /> is rendered 1`] = `
|
|||
class="euiFlexItem emotion-euiFlexItem-growZero"
|
||||
>
|
||||
<button
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-EuiButton"
|
||||
class="euiButton emotion-euiButtonDisplay-m-defaultMinWidth-fill-primary-ToolbarStandardButton"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
|
|
|
@ -2,12 +2,7 @@
|
|||
|
||||
exports[`NoDataCardComponent props button 1`] = `
|
||||
<EuiCard
|
||||
css={
|
||||
Object {
|
||||
"marginInline": "auto",
|
||||
"maxWidth": 400,
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
description="Use Elastic Agent for a simple, unified way to collect data from your machines."
|
||||
footer={
|
||||
<EuiButton
|
||||
|
@ -32,12 +27,7 @@ exports[`NoDataCardComponent props button 1`] = `
|
|||
|
||||
exports[`NoDataCardComponent props href 1`] = `
|
||||
<EuiCard
|
||||
css={
|
||||
Object {
|
||||
"marginInline": "auto",
|
||||
"maxWidth": 400,
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
description="Use Elastic Agent for a simple, unified way to collect data from your machines."
|
||||
footer={
|
||||
<EuiButton
|
||||
|
@ -64,12 +54,7 @@ exports[`NoDataCardComponent props href 1`] = `
|
|||
|
||||
exports[`NoDataCardComponent renders 1`] = `
|
||||
<EuiCard
|
||||
css={
|
||||
Object {
|
||||
"marginInline": "auto",
|
||||
"maxWidth": 400,
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
description="Use Elastic Agent for a simple, unified way to collect data from your machines."
|
||||
footer={
|
||||
<EuiButton
|
||||
|
@ -94,12 +79,7 @@ exports[`NoDataCardComponent renders 1`] = `
|
|||
|
||||
exports[`NoDataCardComponent renders with canAccessFleet false 1`] = `
|
||||
<EuiCard
|
||||
css={
|
||||
Object {
|
||||
"marginInline": "auto",
|
||||
"maxWidth": 400,
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
description={
|
||||
<EuiTextColor
|
||||
color="default"
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
exports[`NoDataCard props button 1`] = `
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingLarge euiCard emotion-euiPanel-grow-m-l-plain-hasShadow-isClickable-EuiCard"
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingLarge euiCard emotion-euiPanel-grow-m-l-plain-hasShadow-isClickable-euiCard-center-NoDataCard"
|
||||
>
|
||||
<div
|
||||
class="euiCard__main emotion-euiCard__main-vertical"
|
||||
|
@ -85,11 +85,11 @@ exports[`NoDataCard props button 1`] = `
|
|||
|
||||
exports[`NoDataCard props extends EuiCardProps 1`] = `
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingLarge euiCard custom_class emotion-euiPanel-grow-m-l-plain-hasShadow-isClickable-EuiCard"
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingLarge euiCard custom_class emotion-euiPanel-grow-m-l-plain-hasShadow-isClickable-euiCard-center-NoDataCard"
|
||||
>
|
||||
<div
|
||||
class="euiCard__main emotion-euiCard__main-vertical"
|
||||
|
@ -168,11 +168,11 @@ exports[`NoDataCard props extends EuiCardProps 1`] = `
|
|||
|
||||
exports[`NoDataCard props href 1`] = `
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingLarge euiCard emotion-euiPanel-grow-m-l-plain-hasShadow-isClickable-EuiCard"
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingLarge euiCard emotion-euiPanel-grow-m-l-plain-hasShadow-isClickable-euiCard-center-NoDataCard"
|
||||
>
|
||||
<div
|
||||
class="euiCard__main emotion-euiCard__main-vertical"
|
||||
|
@ -251,11 +251,11 @@ exports[`NoDataCard props href 1`] = `
|
|||
|
||||
exports[`NoDataCard props no access to Fleet 1`] = `
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--subdued euiPanel--paddingLarge euiCard emotion-euiPanel-grow-m-l-subdued-EuiCard"
|
||||
class="euiPanel euiPanel--subdued euiPanel--paddingLarge euiCard emotion-euiPanel-grow-m-l-subdued-euiCard-center-disabled-NoDataCard"
|
||||
>
|
||||
<div
|
||||
class="euiCard__main emotion-euiCard__main-vertical"
|
||||
|
@ -317,11 +317,11 @@ exports[`NoDataCard props no access to Fleet 1`] = `
|
|||
|
||||
exports[`NoDataCard renders 1`] = `
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingLarge euiCard emotion-euiPanel-grow-m-l-plain-hasShadow-isClickable-EuiCard"
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingLarge euiCard emotion-euiPanel-grow-m-l-plain-hasShadow-isClickable-euiCard-center-NoDataCard"
|
||||
>
|
||||
<div
|
||||
class="euiCard__main emotion-euiCard__main-vertical"
|
||||
|
|
|
@ -3,394 +3,10 @@
|
|||
exports[`<CodeEditor /> hint element should be tabable 1`] = `
|
||||
<div
|
||||
aria-label="Code Editor, activate edit mode"
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop).,false"
|
||||
class="css-139h7n7-keyboardHint-renderPrompt"
|
||||
data-test-subj="codeEditorHint codeEditorHint--active"
|
||||
id="1234"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`<CodeEditor /> is rendered 1`] = `
|
||||
<CodeEditor
|
||||
height={250}
|
||||
intl={
|
||||
Object {
|
||||
"$t": [Function],
|
||||
"defaultFormats": Object {
|
||||
"date": Object {
|
||||
"full": Object {
|
||||
"day": "numeric",
|
||||
"month": "long",
|
||||
"weekday": "long",
|
||||
"year": "numeric",
|
||||
},
|
||||
"long": Object {
|
||||
"day": "numeric",
|
||||
"month": "long",
|
||||
"year": "numeric",
|
||||
},
|
||||
"medium": Object {
|
||||
"day": "numeric",
|
||||
"month": "short",
|
||||
"year": "numeric",
|
||||
},
|
||||
"short": Object {
|
||||
"day": "numeric",
|
||||
"month": "numeric",
|
||||
"year": "2-digit",
|
||||
},
|
||||
},
|
||||
"number": Object {
|
||||
"currency": Object {
|
||||
"style": "currency",
|
||||
},
|
||||
"percent": Object {
|
||||
"style": "percent",
|
||||
},
|
||||
},
|
||||
"relative": Object {
|
||||
"days": Object {
|
||||
"style": "long",
|
||||
},
|
||||
"hours": Object {
|
||||
"style": "long",
|
||||
},
|
||||
"minutes": Object {
|
||||
"style": "long",
|
||||
},
|
||||
"months": Object {
|
||||
"style": "long",
|
||||
},
|
||||
"seconds": Object {
|
||||
"style": "long",
|
||||
},
|
||||
"years": Object {
|
||||
"style": "long",
|
||||
},
|
||||
},
|
||||
"time": Object {
|
||||
"full": Object {
|
||||
"hour": "numeric",
|
||||
"minute": "numeric",
|
||||
"second": "numeric",
|
||||
"timeZoneName": "short",
|
||||
},
|
||||
"long": Object {
|
||||
"hour": "numeric",
|
||||
"minute": "numeric",
|
||||
"second": "numeric",
|
||||
"timeZoneName": "short",
|
||||
},
|
||||
"medium": Object {
|
||||
"hour": "numeric",
|
||||
"minute": "numeric",
|
||||
"second": "numeric",
|
||||
},
|
||||
"short": Object {
|
||||
"hour": "numeric",
|
||||
"minute": "numeric",
|
||||
},
|
||||
},
|
||||
},
|
||||
"defaultLocale": "en",
|
||||
"fallbackOnEmptyString": true,
|
||||
"formatDate": [Function],
|
||||
"formatDateTimeRange": [Function],
|
||||
"formatDateToParts": [Function],
|
||||
"formatDisplayName": [Function],
|
||||
"formatList": [Function],
|
||||
"formatListToParts": [Function],
|
||||
"formatMessage": [Function],
|
||||
"formatNumber": [Function],
|
||||
"formatNumberToParts": [Function],
|
||||
"formatPlural": [Function],
|
||||
"formatRelativeTime": [Function],
|
||||
"formatTime": [Function],
|
||||
"formatTimeToParts": [Function],
|
||||
"formats": Object {},
|
||||
"formatters": Object {
|
||||
"getDateTimeFormat": [Function],
|
||||
"getDisplayNames": [Function],
|
||||
"getListFormat": [Function],
|
||||
"getMessageFormat": [Function],
|
||||
"getNumberFormat": [Function],
|
||||
"getPluralRules": [Function],
|
||||
"getRelativeTimeFormat": [Function],
|
||||
},
|
||||
"locale": "en",
|
||||
"messages": Object {},
|
||||
"onError": [Function],
|
||||
"onWarn": [Function],
|
||||
"timeZone": undefined,
|
||||
}
|
||||
}
|
||||
languageId="loglang"
|
||||
onChange={[Function]}
|
||||
value="
|
||||
[Sun Mar 7 20:54:27 2004] [notice] [client xx.xx.xx.xx] This is a notice!
|
||||
[Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
|
||||
[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome
|
||||
"
|
||||
>
|
||||
<div
|
||||
className="kibanaCodeEditor"
|
||||
data-test-subj="kibanaCodeEditor"
|
||||
onKeyDown={[Function]}
|
||||
>
|
||||
<EuiToolTip
|
||||
content={
|
||||
<React.Fragment>
|
||||
<p>
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="Press {key} to start editing."
|
||||
id="sharedUXPackages.codeEditor.startEditing"
|
||||
values={
|
||||
Object {
|
||||
"key": <strong>
|
||||
Enter
|
||||
</strong>,
|
||||
}
|
||||
}
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="Press {key} to stop editing."
|
||||
id="sharedUXPackages.codeEditor.stopEditing"
|
||||
values={
|
||||
Object {
|
||||
"key": <strong>
|
||||
Esc
|
||||
</strong>,
|
||||
}
|
||||
}
|
||||
/>
|
||||
</p>
|
||||
</React.Fragment>
|
||||
}
|
||||
data-test-subj="codeEditorAccessibilityOverlay"
|
||||
delay="regular"
|
||||
disableScreenReaderOutput={false}
|
||||
display="block"
|
||||
position="top"
|
||||
>
|
||||
<EuiToolTipAnchor
|
||||
display="block"
|
||||
id="generated-id"
|
||||
isVisible={false}
|
||||
onBlur={[Function]}
|
||||
onFocus={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
onMouseOut={[Function]}
|
||||
onMouseOver={[Function]}
|
||||
>
|
||||
<span
|
||||
css="unknown styles"
|
||||
onKeyDown={[Function]}
|
||||
onMouseOut={[Function]}
|
||||
onMouseOver={[Function]}
|
||||
>
|
||||
<Insertion
|
||||
cache={
|
||||
Object {
|
||||
"insert": [Function],
|
||||
"inserted": Object {
|
||||
"uuw4g3-euiToolTipAnchor-block": true,
|
||||
},
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"registered": Object {},
|
||||
"sheet": StyleSheet {
|
||||
"_alreadyInsertedOrderInsensitiveRule": true,
|
||||
"_insertTag": [Function],
|
||||
"before": null,
|
||||
"container": <head>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.emotion-euiToolTipAnchor-block{display:block;}
|
||||
</style>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.emotion-euiToolTipAnchor-block *[disabled]{pointer-events:none;}
|
||||
</style>
|
||||
<style
|
||||
data-styled="active"
|
||||
data-styled-version="5.3.11"
|
||||
/>
|
||||
</head>,
|
||||
"ctr": 2,
|
||||
"insertionPoint": undefined,
|
||||
"isSpeedy": false,
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"prepend": undefined,
|
||||
"tags": Array [
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.emotion-euiToolTipAnchor-block{display:block;}
|
||||
</style>,
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.emotion-euiToolTipAnchor-block *[disabled]{pointer-events:none;}
|
||||
</style>,
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
isStringTag={true}
|
||||
serialized={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "uuw4g3-euiToolTipAnchor-block",
|
||||
"next": undefined,
|
||||
"styles": "*[disabled]{pointer-events:none;};label:euiToolTipAnchor;;;display:block;label:block;;;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
<span
|
||||
className="euiToolTipAnchor emotion-euiToolTipAnchor-block"
|
||||
onKeyDown={[Function]}
|
||||
onMouseOut={[Function]}
|
||||
onMouseOver={[Function]}
|
||||
>
|
||||
<div
|
||||
aria-label="Code Editor, activate edit mode"
|
||||
css={
|
||||
Array [
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "jym74u",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
&:focus {
|
||||
z-index: 6000;
|
||||
}
|
||||
",
|
||||
"toString": [Function],
|
||||
},
|
||||
false,
|
||||
]
|
||||
}
|
||||
data-test-subj="codeEditorHint codeEditorHint--active"
|
||||
id="1234"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onFocus={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
</EuiToolTipAnchor>
|
||||
</EuiToolTip>
|
||||
<Component>
|
||||
<UseBug177756ReBroadcastMouseDown>
|
||||
<div
|
||||
style={
|
||||
Object {
|
||||
"display": "contents",
|
||||
}
|
||||
}
|
||||
>
|
||||
<MockedMonacoEditor
|
||||
editorDidMount={[Function]}
|
||||
editorWillMount={[Function]}
|
||||
editorWillUnmount={[Function]}
|
||||
height={250}
|
||||
language="loglang"
|
||||
onChange={[Function]}
|
||||
options={
|
||||
Object {
|
||||
"bracketPairColorization.enabled": false,
|
||||
"fontFamily": "Roboto Mono",
|
||||
"fontSize": 12,
|
||||
"lineHeight": 21,
|
||||
"matchBrackets": "never",
|
||||
"minimap": Object {
|
||||
"enabled": false,
|
||||
},
|
||||
"padding": Object {},
|
||||
"renderLineHighlight": "none",
|
||||
"scrollBeyondLastLine": false,
|
||||
"scrollbar": Object {
|
||||
"alwaysConsumeMouseWheel": false,
|
||||
"useShadows": false,
|
||||
},
|
||||
"wordBasedSuggestions": false,
|
||||
"wordWrap": "on",
|
||||
"wrappingIndent": "indent",
|
||||
}
|
||||
}
|
||||
theme="codeEditorLightTheme"
|
||||
value="
|
||||
[Sun Mar 7 20:54:27 2004] [notice] [client xx.xx.xx.xx] This is a notice!
|
||||
[Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
|
||||
[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome
|
||||
"
|
||||
>
|
||||
<div>
|
||||
<div />
|
||||
<textarea
|
||||
data-test-subj="monacoEditorTextarea"
|
||||
editorWillUnmount={[Function]}
|
||||
height={250}
|
||||
language="loglang"
|
||||
onChange={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
options={
|
||||
Object {
|
||||
"bracketPairColorization.enabled": false,
|
||||
"fontFamily": "Roboto Mono",
|
||||
"fontSize": 12,
|
||||
"lineHeight": 21,
|
||||
"matchBrackets": "never",
|
||||
"minimap": Object {
|
||||
"enabled": false,
|
||||
},
|
||||
"padding": Object {},
|
||||
"renderLineHighlight": "none",
|
||||
"scrollBeyondLastLine": false,
|
||||
"scrollbar": Object {
|
||||
"alwaysConsumeMouseWheel": false,
|
||||
"useShadows": false,
|
||||
},
|
||||
"wordBasedSuggestions": false,
|
||||
"wordWrap": "on",
|
||||
"wrappingIndent": "indent",
|
||||
}
|
||||
}
|
||||
theme="codeEditorLightTheme"
|
||||
value="
|
||||
[Sun Mar 7 20:54:27 2004] [notice] [client xx.xx.xx.xx] This is a notice!
|
||||
[Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
|
||||
[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</MockedMonacoEditor>
|
||||
</div>
|
||||
</UseBug177756ReBroadcastMouseDown>
|
||||
</Component>
|
||||
</div>
|
||||
</CodeEditor>
|
||||
`;
|
||||
|
|
|
@ -72,14 +72,6 @@ describe('<CodeEditor />', () => {
|
|||
monaco.languages.setMonarchTokensProvider('loglang', simpleLogLang);
|
||||
});
|
||||
|
||||
test('is rendered', () => {
|
||||
const component = mountWithIntl(
|
||||
<CodeEditor languageId="loglang" height={250} value={logs} onChange={() => {}} />
|
||||
);
|
||||
|
||||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('editor mount setup', () => {
|
||||
const suggestionProvider = {
|
||||
provideCompletionItems: (model: monaco.editor.ITextModel, position: monaco.Position) => ({
|
||||
|
|
|
@ -52,7 +52,7 @@ exports[`WithSolutionNav renders wrapped component 1`] = `
|
|||
}
|
||||
pageSideBarProps={
|
||||
Object {
|
||||
"className": "kbnSolutionNav__sidebar css-c34ez9",
|
||||
"className": "kbnSolutionNav__sidebar css-ausb9j-WithSolutionNavStyles",
|
||||
"hasEmbellish": true,
|
||||
"minWidth": undefined,
|
||||
"paddingSize": "none",
|
||||
|
@ -113,7 +113,7 @@ exports[`WithSolutionNav with children 1`] = `
|
|||
}
|
||||
pageSideBarProps={
|
||||
Object {
|
||||
"className": "kbnSolutionNav__sidebar css-c34ez9",
|
||||
"className": "kbnSolutionNav__sidebar css-ausb9j-WithSolutionNavStyles",
|
||||
"hasEmbellish": true,
|
||||
"minWidth": undefined,
|
||||
"paddingSize": "none",
|
||||
|
|
|
@ -11,11 +11,7 @@ exports[`Apply and Cancel change btns enabled when there are changes 1`] = `
|
|||
wrap={true}
|
||||
>
|
||||
<EuiFlexItem
|
||||
css={
|
||||
Object {
|
||||
"minWidth": "250px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inputControlItem"
|
||||
key="mock-list-control"
|
||||
>
|
||||
|
@ -99,11 +95,7 @@ exports[`Clear btns enabled when there are values 1`] = `
|
|||
wrap={true}
|
||||
>
|
||||
<EuiFlexItem
|
||||
css={
|
||||
Object {
|
||||
"minWidth": "250px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inputControlItem"
|
||||
key="mock-list-control"
|
||||
>
|
||||
|
@ -187,11 +179,7 @@ exports[`Renders list control 1`] = `
|
|||
wrap={true}
|
||||
>
|
||||
<EuiFlexItem
|
||||
css={
|
||||
Object {
|
||||
"minWidth": "250px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inputControlItem"
|
||||
key="mock-list-control"
|
||||
>
|
||||
|
@ -275,11 +263,7 @@ exports[`Renders range control 1`] = `
|
|||
wrap={true}
|
||||
>
|
||||
<EuiFlexItem
|
||||
css={
|
||||
Object {
|
||||
"minWidth": "250px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inputControlItem"
|
||||
key="mock-range-control"
|
||||
>
|
||||
|
|
|
@ -12,6 +12,7 @@ import sinon from 'sinon';
|
|||
import { shallow } from 'enzyme';
|
||||
import { mountWithIntl } from '@kbn/test-jest-helpers';
|
||||
import { findTestSubject } from '@elastic/eui/lib/test';
|
||||
import { EuiThemeProvider } from '@elastic/eui';
|
||||
|
||||
import { InputControlVis } from './input_control_vis';
|
||||
import { ListControl } from '../../control/list_control_factory';
|
||||
|
@ -52,6 +53,12 @@ const updateFiltersOnChange = false;
|
|||
|
||||
const refreshControlMock = () => Promise.resolve();
|
||||
|
||||
const Wrapper = ({ children }: { children: React.ReactNode }) => (
|
||||
<EuiThemeProvider>
|
||||
<div>{children}</div>
|
||||
</EuiThemeProvider>
|
||||
);
|
||||
|
||||
let stageFilter: sinon.SinonSpy;
|
||||
let submitFilters: sinon.SinonSpy;
|
||||
let resetControls: sinon.SinonSpy;
|
||||
|
@ -150,21 +157,23 @@ test('Clear btns enabled when there are values', () => {
|
|||
|
||||
test('clearControls', () => {
|
||||
const component = mountWithIntl(
|
||||
<InputControlVis
|
||||
stageFilter={stageFilter}
|
||||
submitFilters={submitFilters}
|
||||
resetControls={resetControls}
|
||||
clearControls={clearControls}
|
||||
controls={[mockListControl]}
|
||||
updateFiltersOnChange={updateFiltersOnChange}
|
||||
hasChanges={() => {
|
||||
return true;
|
||||
}}
|
||||
hasValues={() => {
|
||||
return true;
|
||||
}}
|
||||
refreshControl={refreshControlMock}
|
||||
/>
|
||||
<Wrapper>
|
||||
<InputControlVis
|
||||
stageFilter={stageFilter}
|
||||
submitFilters={submitFilters}
|
||||
resetControls={resetControls}
|
||||
clearControls={clearControls}
|
||||
controls={[mockListControl]}
|
||||
updateFiltersOnChange={updateFiltersOnChange}
|
||||
hasChanges={() => {
|
||||
return true;
|
||||
}}
|
||||
hasValues={() => {
|
||||
return true;
|
||||
}}
|
||||
refreshControl={refreshControlMock}
|
||||
/>
|
||||
</Wrapper>
|
||||
);
|
||||
findTestSubject(component, 'inputControlClearBtn').simulate('click');
|
||||
sinon.assert.calledOnce(clearControls);
|
||||
|
@ -175,21 +184,23 @@ test('clearControls', () => {
|
|||
|
||||
test('submitFilters', () => {
|
||||
const component = mountWithIntl(
|
||||
<InputControlVis
|
||||
stageFilter={stageFilter}
|
||||
submitFilters={submitFilters}
|
||||
resetControls={resetControls}
|
||||
clearControls={clearControls}
|
||||
controls={[mockListControl]}
|
||||
updateFiltersOnChange={updateFiltersOnChange}
|
||||
hasChanges={() => {
|
||||
return true;
|
||||
}}
|
||||
hasValues={() => {
|
||||
return true;
|
||||
}}
|
||||
refreshControl={refreshControlMock}
|
||||
/>
|
||||
<Wrapper>
|
||||
<InputControlVis
|
||||
stageFilter={stageFilter}
|
||||
submitFilters={submitFilters}
|
||||
resetControls={resetControls}
|
||||
clearControls={clearControls}
|
||||
controls={[mockListControl]}
|
||||
updateFiltersOnChange={updateFiltersOnChange}
|
||||
hasChanges={() => {
|
||||
return true;
|
||||
}}
|
||||
hasValues={() => {
|
||||
return true;
|
||||
}}
|
||||
refreshControl={refreshControlMock}
|
||||
/>
|
||||
</Wrapper>
|
||||
);
|
||||
findTestSubject(component, 'inputControlSubmitBtn').simulate('click');
|
||||
sinon.assert.calledOnce(submitFilters);
|
||||
|
@ -200,21 +211,23 @@ test('submitFilters', () => {
|
|||
|
||||
test('resetControls', () => {
|
||||
const component = mountWithIntl(
|
||||
<InputControlVis
|
||||
stageFilter={stageFilter}
|
||||
submitFilters={submitFilters}
|
||||
resetControls={resetControls}
|
||||
clearControls={clearControls}
|
||||
controls={[mockListControl]}
|
||||
updateFiltersOnChange={updateFiltersOnChange}
|
||||
hasChanges={() => {
|
||||
return true;
|
||||
}}
|
||||
hasValues={() => {
|
||||
return true;
|
||||
}}
|
||||
refreshControl={refreshControlMock}
|
||||
/>
|
||||
<Wrapper>
|
||||
<InputControlVis
|
||||
stageFilter={stageFilter}
|
||||
submitFilters={submitFilters}
|
||||
resetControls={resetControls}
|
||||
clearControls={clearControls}
|
||||
controls={[mockListControl]}
|
||||
updateFiltersOnChange={updateFiltersOnChange}
|
||||
hasChanges={() => {
|
||||
return true;
|
||||
}}
|
||||
hasValues={() => {
|
||||
return true;
|
||||
}}
|
||||
refreshControl={refreshControlMock}
|
||||
/>
|
||||
</Wrapper>
|
||||
);
|
||||
findTestSubject(component, 'inputControlCancelBtn').simulate('click');
|
||||
sinon.assert.calledOnce(resetControls);
|
||||
|
|
|
@ -22,13 +22,16 @@ jest.mock('../utils', () => ({
|
|||
}));
|
||||
|
||||
import React from 'react';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import { shallow } from 'enzyme';
|
||||
import { render } from '@testing-library/react';
|
||||
import { IInterpreterRenderHandlers } from '@kbn/expressions-plugin/common';
|
||||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
import { matchers } from '@emotion/jest';
|
||||
import { FormattedColumns, TableVisConfig, TableVisData } from '../types';
|
||||
import TableVisualizationComponent from './table_visualization';
|
||||
import { useUiState } from '../utils';
|
||||
import { TableVisSplit } from './table_vis_split';
|
||||
|
||||
expect.extend(matchers);
|
||||
|
||||
describe('TableVisualizationComponent', () => {
|
||||
const coreStartMock = coreMock.createStart();
|
||||
|
@ -82,7 +85,7 @@ describe('TableVisualizationComponent', () => {
|
|||
});
|
||||
|
||||
it('should render split table and set minWidth for column split', () => {
|
||||
const comp = mount(
|
||||
const { container } = render(
|
||||
<TableVisualizationComponent
|
||||
core={coreStartMock}
|
||||
handlers={handlers}
|
||||
|
@ -127,12 +130,12 @@ describe('TableVisualizationComponent', () => {
|
|||
renderComplete={renderComplete}
|
||||
/>
|
||||
);
|
||||
const splits = comp.find(TableVisSplit).find('.tbvChart__split');
|
||||
|
||||
const splits = container.querySelectorAll('.tbvChart__split');
|
||||
|
||||
expect(splits.length).toBe(2);
|
||||
splits.forEach((split) => {
|
||||
expect((split.prop('css') as { minWidth: string }).minWidth).toEqual(
|
||||
`calc(${77 + 22 + 25}px + 2 * 8px)`
|
||||
);
|
||||
expect(split).toHaveStyleRule('min-width', `calc(${77 + 22 + 25}px + 2 * 8px)`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,28 +3,80 @@
|
|||
exports[`AutoScale withAutoScale renders 1`] = `
|
||||
<Component>
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1l2vzaf",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;justify-content:center;align-items:center;max-width:100%;max-height:100%;overflow:hidden;line-height:1.5;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<div
|
||||
style={
|
||||
<Insertion
|
||||
cache={
|
||||
Object {
|
||||
"transform": "scale(0)",
|
||||
"insert": [Function],
|
||||
"inserted": Object {
|
||||
"4vd3s2-autoScaleWrapperStyle": true,
|
||||
},
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"registered": Object {},
|
||||
"sheet": StyleSheet {
|
||||
"_alreadyInsertedOrderInsensitiveRule": true,
|
||||
"_insertTag": [Function],
|
||||
"before": null,
|
||||
"container": <head>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-4vd3s2-autoScaleWrapperStyle{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:100%;max-height:100%;overflow:hidden;line-height:1.5;}
|
||||
</style>
|
||||
<style
|
||||
data-styled="active"
|
||||
data-styled-version="5.3.11"
|
||||
/>
|
||||
</head>,
|
||||
"ctr": 1,
|
||||
"insertionPoint": undefined,
|
||||
"isSpeedy": false,
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"prepend": undefined,
|
||||
"tags": Array [
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-4vd3s2-autoScaleWrapperStyle{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:100%;max-height:100%;overflow:hidden;line-height:1.5;}
|
||||
</style>,
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
isStringTag={true}
|
||||
serialized={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "4vd3s2-autoScaleWrapperStyle",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;justify-content:center;align-items:center;max-width:100%;max-height:100%;overflow:hidden;line-height:1.5;;label:autoScaleWrapperStyle;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
<div
|
||||
className="css-4vd3s2-autoScaleWrapperStyle"
|
||||
>
|
||||
<Component>
|
||||
<h1>
|
||||
Hoi!
|
||||
</h1>
|
||||
</Component>
|
||||
<div
|
||||
style={
|
||||
Object {
|
||||
"transform": "scale(0)",
|
||||
}
|
||||
}
|
||||
>
|
||||
<Component>
|
||||
<h1>
|
||||
Hoi!
|
||||
</h1>
|
||||
</Component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Component>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import { EuiProvider } from '@elastic/eui';
|
||||
import { Datatable } from '@kbn/expressions-plugin/common';
|
||||
import MetricVisComponent, { MetricVisComponentProps } from './metric_component';
|
||||
import { LabelPosition } from '../../common/constants';
|
||||
|
@ -139,7 +140,7 @@ describe('MetricVisComponent', function () {
|
|||
},
|
||||
});
|
||||
|
||||
mount(component);
|
||||
mount(<EuiProvider>{component}</EuiProvider>);
|
||||
|
||||
expect(renderComplete).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
|
|
@ -49,7 +49,8 @@ describe('MetricVisValue', () => {
|
|||
labelConfig={labelConfig}
|
||||
/>
|
||||
);
|
||||
expect(component.find('button').exists()).toBe(true);
|
||||
|
||||
expect(component.find('[data-test-subj="metric_value_button"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('should not be wrapped in button without having a click listener', () => {
|
||||
|
|
|
@ -79,6 +79,7 @@ export const MetricVisValue = (props: MetricVisValueProps) => {
|
|||
if (onFilter) {
|
||||
return (
|
||||
<button
|
||||
data-test-subj="metric_value_button"
|
||||
css={{ display: 'block' }}
|
||||
onClick={() => onFilter()}
|
||||
title={i18n.translate('expressionLegacyMetricVis.filterTitle', {
|
||||
|
|
|
@ -2,40 +2,11 @@
|
|||
|
||||
exports[`PartitionVisComponent should render correct structure for donut 1`] = `
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13h2mjc",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
;
|
||||
|
||||
inset: 0;
|
||||
position: absolute;
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="partitionVisChart"
|
||||
>
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "19k4zle",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;flex:1 1 auto;min-height:0;min-width:0;width:100%;height:100%;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -932,40 +903,11 @@ exports[`PartitionVisComponent should render correct structure for donut 1`] = `
|
|||
|
||||
exports[`PartitionVisComponent should render correct structure for mosaic 1`] = `
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13h2mjc",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
;
|
||||
|
||||
inset: 0;
|
||||
position: absolute;
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="partitionVisChart"
|
||||
>
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "19k4zle",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;flex:1 1 auto;min-height:0;min-width:0;width:100%;height:100%;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -1863,40 +1805,11 @@ exports[`PartitionVisComponent should render correct structure for mosaic 1`] =
|
|||
|
||||
exports[`PartitionVisComponent should render correct structure for multi-metric pie 1`] = `
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13h2mjc",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
;
|
||||
|
||||
inset: 0;
|
||||
position: absolute;
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="partitionVisChart"
|
||||
>
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "19k4zle",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;flex:1 1 auto;min-height:0;min-width:0;width:100%;height:100%;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -2914,40 +2827,11 @@ exports[`PartitionVisComponent should render correct structure for multi-metric
|
|||
|
||||
exports[`PartitionVisComponent should render correct structure for pie 1`] = `
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13h2mjc",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
;
|
||||
|
||||
inset: 0;
|
||||
position: absolute;
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="partitionVisChart"
|
||||
>
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "19k4zle",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;flex:1 1 auto;min-height:0;min-width:0;width:100%;height:100%;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -3844,40 +3728,11 @@ exports[`PartitionVisComponent should render correct structure for pie 1`] = `
|
|||
|
||||
exports[`PartitionVisComponent should render correct structure for treemap 1`] = `
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13h2mjc",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
;
|
||||
|
||||
inset: 0;
|
||||
position: absolute;
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="partitionVisChart"
|
||||
>
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "19k4zle",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;flex:1 1 auto;min-height:0;min-width:0;width:100%;height:100%;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -4772,40 +4627,11 @@ exports[`PartitionVisComponent should render correct structure for treemap 1`] =
|
|||
|
||||
exports[`PartitionVisComponent should render correct structure for waffle 1`] = `
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13h2mjc",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
;
|
||||
|
||||
inset: 0;
|
||||
position: absolute;
|
||||
padding: 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="partitionVisChart"
|
||||
>
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "19k4zle",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;flex:1 1 auto;min-height:0;min-width:0;width:100%;height:100%;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiProvider } from '@elastic/eui';
|
||||
import { Wordcloud, Settings, WordcloudSpec, Chart } from '@elastic/charts';
|
||||
import { chartPluginMock } from '@kbn/charts-plugin/public/mocks';
|
||||
import type { Datatable } from '@kbn/expressions-plugin/public';
|
||||
|
@ -98,6 +99,10 @@ describe('TagCloudChart', function () {
|
|||
let wrapperPropsWithIndexes: TagCloudChartProps;
|
||||
let wrapperPropsWithColumnNames: TagCloudChartProps;
|
||||
|
||||
const WrappingComponent = ({ children }: { children: React.ReactNode }) => (
|
||||
<EuiProvider>{children}</EuiProvider>
|
||||
);
|
||||
|
||||
beforeAll(() => {
|
||||
wrapperPropsWithIndexes = {
|
||||
visData,
|
||||
|
@ -143,12 +148,16 @@ describe('TagCloudChart', function () {
|
|||
});
|
||||
|
||||
it('renders the Wordcloud component with', async () => {
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithIndexes} />);
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithIndexes} />, {
|
||||
wrappingComponent: WrappingComponent,
|
||||
});
|
||||
expect(component.find(Wordcloud).length).toBe(1);
|
||||
});
|
||||
|
||||
it('renders the label correctly', async () => {
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithIndexes} />);
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithIndexes} />, {
|
||||
wrappingComponent: WrappingComponent,
|
||||
});
|
||||
const label = findTestSubject(component, 'tagCloudLabel');
|
||||
expect(label.text()).toEqual('geo.dest: Descending - Count');
|
||||
});
|
||||
|
@ -156,18 +165,24 @@ describe('TagCloudChart', function () {
|
|||
it('not renders the label if showLabel setting is off', async () => {
|
||||
const newVisParams = { ...visParams, showLabel: false };
|
||||
const newProps = { ...wrapperPropsWithIndexes, visParams: newVisParams };
|
||||
const component = mount(<TagCloudChart {...newProps} />);
|
||||
const component = mount(<TagCloudChart {...newProps} />, {
|
||||
wrappingComponent: WrappingComponent,
|
||||
});
|
||||
const label = findTestSubject(component, 'tagCloudLabel');
|
||||
expect(label.length).toBe(0);
|
||||
});
|
||||
|
||||
it('receives the data in the correct format for bucket and metric accessors of type number', () => {
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithIndexes} />);
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithIndexes} />, {
|
||||
wrappingComponent: WrappingComponent,
|
||||
});
|
||||
expect(component.find(Wordcloud).prop('data')).toStrictEqual(formattedData);
|
||||
});
|
||||
|
||||
it('receives the data in the correct format for bucket and metric accessors of type DatatableColumn', () => {
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithColumnNames} />);
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithColumnNames} />, {
|
||||
wrappingComponent: WrappingComponent,
|
||||
});
|
||||
expect(component.find(Wordcloud).prop('data')).toStrictEqual(formattedData);
|
||||
});
|
||||
|
||||
|
@ -177,13 +192,17 @@ describe('TagCloudChart', function () {
|
|||
orientation: Orientation.RIGHT_ANGLED,
|
||||
};
|
||||
const newProps = { ...wrapperPropsWithIndexes, visParams: newVisParams };
|
||||
const component = mount(<TagCloudChart {...newProps} />);
|
||||
const component = mount(<TagCloudChart {...newProps} />, {
|
||||
wrappingComponent: WrappingComponent,
|
||||
});
|
||||
expect(component.find(Wordcloud).prop('endAngle')).toBe(90);
|
||||
expect(component.find(Wordcloud).prop('angleCount')).toBe(2);
|
||||
});
|
||||
|
||||
it('calls filter callback', () => {
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithIndexes} />);
|
||||
const component = mount(<TagCloudChart {...wrapperPropsWithIndexes} />, {
|
||||
wrappingComponent: WrappingComponent,
|
||||
});
|
||||
component.find(Settings).prop('onElementClick')!([
|
||||
[
|
||||
{
|
||||
|
@ -205,7 +224,10 @@ describe('TagCloudChart', function () {
|
|||
<TagCloudChart
|
||||
{...wrapperPropsWithIndexes}
|
||||
overrides={{ settings: { rotation: -90 }, chart: { title: 'Hello' } }}
|
||||
/>
|
||||
/>,
|
||||
{
|
||||
wrappingComponent: WrappingComponent,
|
||||
}
|
||||
);
|
||||
expect(component.find(Chart).props().title).toBe('Hello');
|
||||
expect(component.find(Settings).props().rotation).toBe(-90);
|
||||
|
|
|
@ -292,15 +292,7 @@ exports[`XYChart component it renders area 1`] = `
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -1141,15 +1133,7 @@ exports[`XYChart component it renders area 1`] = `
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -1858,15 +1842,7 @@ exports[`XYChart component it renders bar 1`] = `
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -2707,15 +2683,7 @@ exports[`XYChart component it renders bar 1`] = `
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -3424,15 +3392,7 @@ exports[`XYChart component it renders horizontal bar 1`] = `
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -4273,15 +4233,7 @@ exports[`XYChart component it renders horizontal bar 1`] = `
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -4990,15 +4942,7 @@ exports[`XYChart component it renders line 1`] = `
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -5839,15 +5783,7 @@ exports[`XYChart component it renders line 1`] = `
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -6556,15 +6492,7 @@ exports[`XYChart component it renders stacked area 1`] = `
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -7405,15 +7333,7 @@ exports[`XYChart component it renders stacked area 1`] = `
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -8122,15 +8042,7 @@ exports[`XYChart component it renders stacked bar 1`] = `
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -8971,15 +8883,7 @@ exports[`XYChart component it renders stacked bar 1`] = `
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -9688,15 +9592,7 @@ exports[`XYChart component it renders stacked horizontal bar 1`] = `
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -10537,15 +10433,7 @@ exports[`XYChart component it renders stacked horizontal bar 1`] = `
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -11254,15 +11142,7 @@ exports[`XYChart component split chart should render split chart if both, splitR
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -12133,15 +12013,7 @@ exports[`XYChart component split chart should render split chart if both, splitR
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -13064,15 +12936,7 @@ exports[`XYChart component split chart should render split chart if splitColumnA
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -13937,15 +13801,7 @@ exports[`XYChart component split chart should render split chart if splitColumnA
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
@ -14861,15 +14717,7 @@ exports[`XYChart component split chart should render split chart if splitRowAcce
|
|||
<Fragment>
|
||||
<GlobalXYChartStyles />
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "2lyuno",
|
||||
"next": undefined,
|
||||
"styles": "width:100%;height:100%;overflow-x:hidden;position:relative;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ContextProvider
|
||||
value={
|
||||
|
@ -15734,15 +15582,7 @@ exports[`XYChart component split chart should render split chart if splitRowAcce
|
|||
locale="en"
|
||||
noResults={
|
||||
<EmptyPlaceholder
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "16rwds4",
|
||||
"next": undefined,
|
||||
"styles": "height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
icon={[Function]}
|
||||
renderComplete={[Function]}
|
||||
/>
|
||||
|
|
|
@ -4,7 +4,7 @@ exports[`EndzoneTooltipHeader should render endzone tooltip with value, if it is
|
|||
<Fragment>
|
||||
<EuiFlexGroup
|
||||
alignItems="center"
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
gutterSize="xs"
|
||||
responsive={false}
|
||||
>
|
||||
|
@ -32,7 +32,7 @@ exports[`EndzoneTooltipHeader should render endzone tooltip without value, if it
|
|||
<Fragment>
|
||||
<EuiFlexGroup
|
||||
alignItems="center"
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
gutterSize="xs"
|
||||
responsive={false}
|
||||
>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`Tooltip should render plain tooltip 1`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<table>
|
||||
<tbody>
|
||||
|
@ -38,10 +38,10 @@ exports[`Tooltip should render plain tooltip 1`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip with partial buckets 1`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EndzoneTooltipHeader />
|
||||
</div>
|
||||
|
@ -79,10 +79,10 @@ exports[`Tooltip should render tooltip with partial buckets 1`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip with partial buckets 2`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EndzoneTooltipHeader />
|
||||
</div>
|
||||
|
@ -120,7 +120,7 @@ exports[`Tooltip should render tooltip with partial buckets 2`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip with xDomain 1`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<table>
|
||||
<tbody>
|
||||
|
@ -156,7 +156,7 @@ exports[`Tooltip should render tooltip with xDomain 1`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip without split-column-values 1`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<table>
|
||||
<tbody>
|
||||
|
@ -187,7 +187,7 @@ exports[`Tooltip should render tooltip without split-column-values 1`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip without split-row-values 1`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<table>
|
||||
<tbody>
|
||||
|
@ -218,7 +218,7 @@ exports[`Tooltip should render tooltip without split-row-values 1`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip without splitAccessors-values 1`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<table>
|
||||
<tbody>
|
||||
|
@ -249,7 +249,7 @@ exports[`Tooltip should render tooltip without splitAccessors-values 1`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip without x-value 1`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<table>
|
||||
<tbody>
|
||||
|
@ -280,7 +280,7 @@ exports[`Tooltip should render tooltip without x-value 1`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip without x-value 2`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<table>
|
||||
<tbody>
|
||||
|
@ -311,7 +311,7 @@ exports[`Tooltip should render tooltip without x-value 2`] = `
|
|||
|
||||
exports[`Tooltip should render tooltip without y-value 1`] = `
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<table>
|
||||
<tbody>
|
||||
|
|
|
@ -3,27 +3,17 @@
|
|||
exports[`TooltipRow should render label and value if both are specified 1`] = `
|
||||
<tr>
|
||||
<td
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
<div
|
||||
css={[Function]}
|
||||
css="unknown styles"
|
||||
>
|
||||
tooltip
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "us16fb",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
overflow-wrap: break-word;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
0
|
||||
</div>
|
||||
|
|
|
@ -966,7 +966,7 @@ describe('XYChart component', () => {
|
|||
|
||||
test('it renders regular bar empty placeholder for no results', () => {
|
||||
const { data, args } = sampleArgs();
|
||||
const component = shallow(
|
||||
const component = mountWithIntl(
|
||||
<XYChart
|
||||
{...defaultProps}
|
||||
args={{
|
||||
|
@ -989,7 +989,7 @@ describe('XYChart component', () => {
|
|||
return layer;
|
||||
}
|
||||
});
|
||||
const component = shallow(
|
||||
const component = mountWithIntl(
|
||||
<XYChart
|
||||
{...defaultProps}
|
||||
args={{
|
||||
|
@ -1585,7 +1585,7 @@ describe('XYChart component', () => {
|
|||
test('it renders stacked bar empty placeholder for no results', () => {
|
||||
const { args } = sampleArgs();
|
||||
|
||||
const component = shallow(
|
||||
const component = mountWithIntl(
|
||||
<XYChart
|
||||
{...defaultProps}
|
||||
args={{
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiThemeProvider } from '@elastic/eui';
|
||||
|
||||
import { useBatchedPublishingSubjects as mockUseBatchedPublishingSubjects } from '@kbn/presentation-publishing';
|
||||
import { DashboardPanelMap } from '../../../common';
|
||||
|
@ -85,11 +86,13 @@ const createAndMountDashboardGrid = async (panels: DashboardPanelMap = PANELS) =
|
|||
},
|
||||
});
|
||||
const component = render(
|
||||
<DashboardContext.Provider value={api}>
|
||||
<DashboardInternalContext.Provider value={internalApi}>
|
||||
<DashboardGrid />
|
||||
</DashboardInternalContext.Provider>
|
||||
</DashboardContext.Provider>
|
||||
<EuiThemeProvider>
|
||||
<DashboardContext.Provider value={api}>
|
||||
<DashboardInternalContext.Provider value={internalApi}>
|
||||
<DashboardGrid />
|
||||
</DashboardInternalContext.Provider>
|
||||
</DashboardContext.Provider>
|
||||
</EuiThemeProvider>
|
||||
);
|
||||
|
||||
// wait for first render
|
||||
|
|
|
@ -81,7 +81,7 @@ test("shouldn't show indicator in case no active search session", async () => {
|
|||
expect(container).toMatchInlineSnapshot(`
|
||||
<div>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
/>
|
||||
</div>
|
||||
|
@ -111,7 +111,7 @@ test("shouldn't show indicator in case app hasn't opt-in", async () => {
|
|||
expect(container).toMatchInlineSnapshot(`
|
||||
<div>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -184,10 +184,9 @@ describe('Search Sessions Management table column factory', () => {
|
|||
...mockSession,
|
||||
...partialSession,
|
||||
};
|
||||
const node = mount(
|
||||
nameColumn.render!(session.name, session) as ReactElement
|
||||
).getDOMNode();
|
||||
return !!node.querySelector('[data-test-subj="versionIncompatibleWarningTestSubj"]');
|
||||
const node = mount(nameColumn.render!(session.name, session) as ReactElement);
|
||||
|
||||
return node.find('[data-test-subj="versionIncompatibleWarningTestSubj"]').exists();
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ Array [
|
|||
class="euiSpacer euiSpacer--s emotion-euiSpacer-s"
|
||||
/>,
|
||||
<div
|
||||
class="euiBasicTable insDataTableFormat__table eui-xScroll css-1f59z3t"
|
||||
class="euiBasicTable insDataTableFormat__table eui-xScroll css-bhtp2o-DataTableFormatClass"
|
||||
data-test-subj="inspectorTable"
|
||||
>
|
||||
<table
|
||||
|
@ -488,7 +488,7 @@ Array [
|
|||
class="euiSpacer euiSpacer--s emotion-euiSpacer-s"
|
||||
/>,
|
||||
<div
|
||||
class="euiBasicTable insDataTableFormat__table eui-xScroll css-1f59z3t"
|
||||
class="euiBasicTable insDataTableFormat__table eui-xScroll css-bhtp2o-DataTableFormatClass"
|
||||
data-test-subj="inspectorTable"
|
||||
>
|
||||
<table
|
||||
|
|
|
@ -5,12 +5,7 @@ exports[`FieldFormatEditor should render normally 1`] = `
|
|||
<Suspense
|
||||
fallback={
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"marginTop": 8,
|
||||
"minHeight": 430,
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiDelayRender
|
||||
delay={500}
|
||||
|
@ -38,12 +33,7 @@ exports[`FieldFormatEditor should render nothing if there is no editor for the f
|
|||
<Suspense
|
||||
fallback={
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"marginTop": 8,
|
||||
"minHeight": 430,
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiDelayRender
|
||||
delay={500}
|
||||
|
|
|
@ -40,11 +40,7 @@ exports[`StaticLookupFormatEditor should render multiple lookup entries and unkn
|
|||
},
|
||||
]
|
||||
}
|
||||
css={
|
||||
Object {
|
||||
"maxWidth": "400px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
items={
|
||||
Array [
|
||||
Object {
|
||||
|
@ -58,13 +54,6 @@ exports[`StaticLookupFormatEditor should render multiple lookup entries and unkn
|
|||
},
|
||||
]
|
||||
}
|
||||
noItemsMessage={
|
||||
<EuiI18n
|
||||
default="No items found"
|
||||
token="euiBasicTable.noItemsMessage"
|
||||
/>
|
||||
}
|
||||
tableLayout="fixed"
|
||||
/>
|
||||
<EuiSpacer
|
||||
size="m"
|
||||
|
@ -144,11 +133,7 @@ exports[`StaticLookupFormatEditor should render normally 1`] = `
|
|||
},
|
||||
]
|
||||
}
|
||||
css={
|
||||
Object {
|
||||
"maxWidth": "400px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
items={
|
||||
Array [
|
||||
Object {
|
||||
|
@ -156,13 +141,6 @@ exports[`StaticLookupFormatEditor should render normally 1`] = `
|
|||
},
|
||||
]
|
||||
}
|
||||
noItemsMessage={
|
||||
<EuiI18n
|
||||
default="No items found"
|
||||
token="euiBasicTable.noItemsMessage"
|
||||
/>
|
||||
}
|
||||
tableLayout="fixed"
|
||||
/>
|
||||
<EuiSpacer
|
||||
size="m"
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
exports[`EmptyIndexListPrompt should render normally 1`] = `
|
||||
<EuiPanel
|
||||
className="inpEmptyState"
|
||||
color="subdued"
|
||||
css="unknown styles"
|
||||
data-test-subj="indexPatternEmptyState"
|
||||
hasShadow={false}
|
||||
paddingSize="xl"
|
||||
|
|
|
@ -5,12 +5,7 @@ exports[`FieldFormatEditor should render normally 1`] = `
|
|||
<Suspense
|
||||
fallback={
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"marginTop": 8,
|
||||
"minHeight": 430,
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiDelayRender
|
||||
delay={500}
|
||||
|
@ -38,12 +33,7 @@ exports[`FieldFormatEditor should render nothing if there is no editor for the f
|
|||
<Suspense
|
||||
fallback={
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"marginTop": 8,
|
||||
"minHeight": 430,
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiDelayRender
|
||||
delay={500}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiProvider } from '@elastic/eui';
|
||||
import { mountWithIntl } from '@kbn/test-jest-helpers';
|
||||
import type { ReactWrapper } from 'enzyme';
|
||||
import { LoadingSpinner } from './loading_spinner';
|
||||
|
@ -17,7 +18,11 @@ describe('loading spinner', function () {
|
|||
let component: ReactWrapper;
|
||||
|
||||
it('LoadingSpinner renders a Searching text and a spinner', () => {
|
||||
component = mountWithIntl(<LoadingSpinner />);
|
||||
component = mountWithIntl(
|
||||
<EuiProvider>
|
||||
<LoadingSpinner />
|
||||
</EuiProvider>
|
||||
);
|
||||
expect(findTestSubject(component, 'loadingSpinnerText').text()).toBe('Searching');
|
||||
expect(findTestSubject(component, 'loadingSpinner').length).toBe(1);
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import { BehaviorSubject } from 'rxjs';
|
||||
import type { ReactWrapper } from 'enzyme';
|
||||
import { findTestSubject } from '@elastic/eui/lib/test';
|
||||
import { EuiProgress } from '@elastic/eui';
|
||||
import { EuiProgress, EuiProvider } from '@elastic/eui';
|
||||
import { getDataTableRecords, realHits } from '../../../../__fixtures__/real_hits';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mountWithIntl } from '@kbn/test-jest-helpers';
|
||||
|
@ -208,13 +208,15 @@ async function mountComponent(
|
|||
|
||||
await act(async () => {
|
||||
comp = mountWithIntl(
|
||||
<KibanaContextProvider services={mockedServices}>
|
||||
<DiscoverMainProvider value={stateContainer}>
|
||||
<RuntimeStateProvider currentDataView={props.selectedDataView!} adHocDataViews={[]}>
|
||||
<DiscoverSidebarResponsive {...props} />{' '}
|
||||
</RuntimeStateProvider>
|
||||
</DiscoverMainProvider>
|
||||
</KibanaContextProvider>
|
||||
<EuiProvider>
|
||||
<KibanaContextProvider services={mockedServices}>
|
||||
<DiscoverMainProvider value={stateContainer}>
|
||||
<RuntimeStateProvider currentDataView={props.selectedDataView!} adHocDataViews={[]}>
|
||||
<DiscoverSidebarResponsive {...props} />{' '}
|
||||
</RuntimeStateProvider>
|
||||
</DiscoverMainProvider>
|
||||
</KibanaContextProvider>
|
||||
</EuiProvider>
|
||||
);
|
||||
// wait for lazy modules
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
|
|
|
@ -38,7 +38,7 @@ jest.mock('../../customizations', () => {
|
|||
|
||||
jest.mock('./discover_main_app', () => {
|
||||
return {
|
||||
DiscoverMainApp: jest.fn().mockReturnValue(<></>),
|
||||
DiscoverMainApp: jest.fn(() => <></>),
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ exports[`TableHeader with time column renders correctly 1`] = `
|
|||
data-test-subj="docTableHeader"
|
||||
>
|
||||
<th
|
||||
css="[object Object]"
|
||||
class="css-mglpjj-TableHeader"
|
||||
/>
|
||||
<th
|
||||
data-test-subj="docTableHeaderField"
|
||||
|
@ -211,7 +211,7 @@ exports[`TableHeader without time column renders correctly 1`] = `
|
|||
data-test-subj="docTableHeader"
|
||||
>
|
||||
<th
|
||||
css="[object Object]"
|
||||
class="css-mglpjj-TableHeader"
|
||||
/>
|
||||
<th
|
||||
data-test-subj="docTableHeaderField"
|
||||
|
|
|
@ -336,9 +336,7 @@ describe('ExpressionRenderer', () => {
|
|||
});
|
||||
|
||||
const instance = mount(<ReactExpressionRenderer className="myClassName" expression="" />);
|
||||
// Counte is 2 because the class is applied to ReactExpressionRenderer + internal component
|
||||
expect(instance.find('.myClassName').length).toBe(2);
|
||||
|
||||
instance.unmount();
|
||||
expect(instance.find('div.myClassName').length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -42,8 +42,8 @@ jest.mock('../kibana_services', () => ({
|
|||
|
||||
jest.mock('@kbn/kibana-react-plugin/public', () => ({
|
||||
overviewPageActions: jest.fn().mockReturnValue([]),
|
||||
OverviewPageFooter: jest.fn().mockReturnValue(<></>),
|
||||
KibanaPageTemplate: jest.fn().mockReturnValue(<></>),
|
||||
OverviewPageFooter: jest.fn(() => <></>),
|
||||
KibanaPageTemplate: jest.fn(() => <></>),
|
||||
}));
|
||||
|
||||
describe('home', () => {
|
||||
|
|
|
@ -7,11 +7,7 @@ exports[`render 1`] = `
|
|||
paddingSize="none"
|
||||
>
|
||||
<EuiTabs
|
||||
css={
|
||||
Object {
|
||||
"padding": "0 24px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiTab
|
||||
isSelected={true}
|
||||
|
@ -102,11 +98,7 @@ exports[`statusCheckState checking status 1`] = `
|
|||
paddingSize="none"
|
||||
>
|
||||
<EuiTabs
|
||||
css={
|
||||
Object {
|
||||
"padding": "0 24px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiTab
|
||||
isSelected={true}
|
||||
|
@ -216,11 +208,7 @@ exports[`statusCheckState failed status check - error 1`] = `
|
|||
paddingSize="none"
|
||||
>
|
||||
<EuiTabs
|
||||
css={
|
||||
Object {
|
||||
"padding": "0 24px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiTab
|
||||
isSelected={true}
|
||||
|
@ -339,11 +327,7 @@ exports[`statusCheckState failed status check - no data 1`] = `
|
|||
paddingSize="none"
|
||||
>
|
||||
<EuiTabs
|
||||
css={
|
||||
Object {
|
||||
"padding": "0 24px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiTab
|
||||
isSelected={true}
|
||||
|
@ -462,11 +446,7 @@ exports[`statusCheckState initial state - no check has been attempted 1`] = `
|
|||
paddingSize="none"
|
||||
>
|
||||
<EuiTabs
|
||||
css={
|
||||
Object {
|
||||
"padding": "0 24px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiTab
|
||||
isSelected={true}
|
||||
|
@ -576,11 +556,7 @@ exports[`statusCheckState successful status check 1`] = `
|
|||
paddingSize="none"
|
||||
>
|
||||
<EuiTabs
|
||||
css={
|
||||
Object {
|
||||
"padding": "0 24px",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiTab
|
||||
isSelected={true}
|
||||
|
|
|
@ -2,11 +2,7 @@
|
|||
|
||||
exports[`render partial should display callout when request timed out 1`] = `
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"width": "100%",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inspectorRequestClustersDetails"
|
||||
size="xs"
|
||||
>
|
||||
|
@ -32,11 +28,7 @@ exports[`render partial should display callout when request timed out 1`] = `
|
|||
|
||||
exports[`render partial should show view shard failure button when there are shard failures 1`] = `
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"width": "100%",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inspectorRequestClustersDetails"
|
||||
size="xs"
|
||||
>
|
||||
|
@ -74,11 +66,7 @@ exports[`render partial should show view shard failure button when there are sha
|
|||
|
||||
exports[`render should display success 1`] = `
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"width": "100%",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inspectorRequestClustersDetails"
|
||||
size="xs"
|
||||
>
|
||||
|
@ -98,11 +86,7 @@ exports[`render should display success 1`] = `
|
|||
|
||||
exports[`render skipped or failed should display callout when cluster is unavailable 1`] = `
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"width": "100%",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inspectorRequestClustersDetails"
|
||||
size="xs"
|
||||
>
|
||||
|
@ -124,11 +108,7 @@ exports[`render skipped or failed should display callout when cluster is unavail
|
|||
|
||||
exports[`render skipped or failed should display callout with view failed shards button when all shards fail 1`] = `
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"width": "100%",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
data-test-subj="inspectorRequestClustersDetails"
|
||||
size="xs"
|
||||
>
|
||||
|
|
|
@ -27,14 +27,7 @@ exports[`ElasticAgentCard props button 1`] = `
|
|||
image={
|
||||
<EuiImage
|
||||
alt=""
|
||||
css={
|
||||
Object {
|
||||
"background": "aliceblue",
|
||||
"height": 240,
|
||||
"objectFit": "cover",
|
||||
"width": "max(100%, 360px)",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="fullWidth"
|
||||
url="/plugins/kibanaReact/assets/elastic_agent_card.svg"
|
||||
/>
|
||||
|
@ -78,14 +71,7 @@ exports[`ElasticAgentCard props category 1`] = `
|
|||
image={
|
||||
<EuiImage
|
||||
alt=""
|
||||
css={
|
||||
Object {
|
||||
"background": "aliceblue",
|
||||
"height": 240,
|
||||
"objectFit": "cover",
|
||||
"width": "max(100%, 360px)",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="fullWidth"
|
||||
url="/plugins/kibanaReact/assets/elastic_agent_card.svg"
|
||||
/>
|
||||
|
@ -129,14 +115,7 @@ exports[`ElasticAgentCard props href 1`] = `
|
|||
image={
|
||||
<EuiImage
|
||||
alt=""
|
||||
css={
|
||||
Object {
|
||||
"background": "aliceblue",
|
||||
"height": 240,
|
||||
"objectFit": "cover",
|
||||
"width": "max(100%, 360px)",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="fullWidth"
|
||||
url="/plugins/kibanaReact/assets/elastic_agent_card.svg"
|
||||
/>
|
||||
|
@ -185,14 +164,7 @@ exports[`ElasticAgentCard props recommended 1`] = `
|
|||
image={
|
||||
<EuiImage
|
||||
alt=""
|
||||
css={
|
||||
Object {
|
||||
"background": "aliceblue",
|
||||
"height": 240,
|
||||
"objectFit": "cover",
|
||||
"width": "max(100%, 360px)",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="fullWidth"
|
||||
url="/plugins/kibanaReact/assets/elastic_agent_card.svg"
|
||||
/>
|
||||
|
@ -236,14 +208,7 @@ exports[`ElasticAgentCard renders 1`] = `
|
|||
image={
|
||||
<EuiImage
|
||||
alt=""
|
||||
css={
|
||||
Object {
|
||||
"background": "aliceblue",
|
||||
"height": 240,
|
||||
"objectFit": "cover",
|
||||
"width": "max(100%, 360px)",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="fullWidth"
|
||||
url="/plugins/kibanaReact/assets/elastic_agent_card.svg"
|
||||
/>
|
||||
|
|
|
@ -14,6 +14,7 @@ import { SavedObjectSaveModal } from './saved_object_save_modal';
|
|||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { EuiProvider } from '@elastic/eui';
|
||||
|
||||
describe('SavedObjectSaveModal', () => {
|
||||
it('should render matching snapshot', () => {
|
||||
|
@ -98,17 +99,19 @@ describe('SavedObjectSaveModal', () => {
|
|||
const onSave = jest.fn();
|
||||
|
||||
render(
|
||||
<I18nProvider>
|
||||
<SavedObjectSaveModal
|
||||
onSave={onSave}
|
||||
onClose={() => void 0}
|
||||
title={'Saved Object title'}
|
||||
objectType="visualization"
|
||||
showDescription={true}
|
||||
showCopyOnSave={true}
|
||||
mustCopyOnSaveMessage="You must save a copy of the object."
|
||||
/>
|
||||
</I18nProvider>
|
||||
<EuiProvider>
|
||||
<I18nProvider>
|
||||
<SavedObjectSaveModal
|
||||
onSave={onSave}
|
||||
onClose={() => void 0}
|
||||
title={'Saved Object title'}
|
||||
objectType="visualization"
|
||||
showDescription={true}
|
||||
showCopyOnSave={true}
|
||||
mustCopyOnSaveMessage="You must save a copy of the object."
|
||||
/>
|
||||
</I18nProvider>
|
||||
</EuiProvider>
|
||||
);
|
||||
|
||||
expect(onSave).not.toHaveBeenCalled();
|
||||
|
|
|
@ -87,17 +87,7 @@ describe('useTimeRange', () => {
|
|||
);
|
||||
expect(result.current.timeRangeDisplay).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1vgo99t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 0 8px 0 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="xs"
|
||||
textAlign="center"
|
||||
>
|
||||
|
@ -122,17 +112,7 @@ describe('useTimeRange', () => {
|
|||
expect(result.current.timeRangeDisplay).toMatchInlineSnapshot(`
|
||||
<EuiFlexGroup
|
||||
alignItems="baseline"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1ly21re",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
flex-grow: 0;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
gutterSize="none"
|
||||
justifyContent="center"
|
||||
responsive={false}
|
||||
|
@ -141,17 +121,7 @@ describe('useTimeRange', () => {
|
|||
grow={false}
|
||||
>
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1vgo99t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 0 8px 0 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="xs"
|
||||
textAlign="center"
|
||||
>
|
||||
|
@ -188,17 +158,7 @@ describe('useTimeRange', () => {
|
|||
expect(result.current.timeRangeDisplay).toMatchInlineSnapshot(`
|
||||
<EuiFlexGroup
|
||||
alignItems="baseline"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1ly21re",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
flex-grow: 0;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
gutterSize="none"
|
||||
justifyContent="center"
|
||||
responsive={false}
|
||||
|
@ -207,17 +167,7 @@ describe('useTimeRange', () => {
|
|||
grow={false}
|
||||
>
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1vgo99t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 0 8px 0 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="xs"
|
||||
textAlign="center"
|
||||
>
|
||||
|
@ -251,17 +201,7 @@ describe('useTimeRange', () => {
|
|||
);
|
||||
expect(result.current.timeRangeDisplay).toMatchInlineSnapshot(`
|
||||
<EuiText
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1vgo99t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
padding: 0 8px 0 8px;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="xs"
|
||||
textAlign="center"
|
||||
>
|
||||
|
|
|
@ -11,10 +11,10 @@ import { ChatContextMenu } from './chat_context_menu';
|
|||
import { useConfirmModal } from '../hooks';
|
||||
|
||||
jest.mock('../hooks/use_confirm_modal', () => ({
|
||||
useConfirmModal: jest.fn().mockReturnValue({
|
||||
useConfirmModal: jest.fn(() => ({
|
||||
element: <div data-test-subj="confirmModal" />,
|
||||
confirm: jest.fn(() => Promise.resolve(true)),
|
||||
}),
|
||||
})),
|
||||
}));
|
||||
|
||||
describe('ChatContextMenu', () => {
|
||||
|
|
|
@ -20,10 +20,10 @@ jest.mock('../hooks/use_conversations_by_date', () => ({
|
|||
}));
|
||||
|
||||
jest.mock('../hooks/use_confirm_modal', () => ({
|
||||
useConfirmModal: jest.fn().mockReturnValue({
|
||||
useConfirmModal: jest.fn(() => ({
|
||||
element: <div data-test-subj="confirmModal" />,
|
||||
confirm: jest.fn(() => Promise.resolve(true)),
|
||||
}),
|
||||
})),
|
||||
}));
|
||||
|
||||
jest.mock('../hooks/use_conversation_context_menu', () => ({
|
||||
|
|
|
@ -47,18 +47,86 @@ exports[`<ExportApp /> renders as expected 1`] = `
|
|||
</RoutingLink>
|
||||
</div>
|
||||
<div
|
||||
className="canvasExport__stageContent"
|
||||
css="unknown styles"
|
||||
data-shared-items-count={3}
|
||||
>
|
||||
<WorkpadPage
|
||||
isSelected={true}
|
||||
registerLayout={[Function]}
|
||||
unregisterLayout={[Function]}
|
||||
<Insertion
|
||||
cache={
|
||||
Object {
|
||||
"insert": [Function],
|
||||
"inserted": Object {
|
||||
"17hzfsv-ExportApp": true,
|
||||
},
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"registered": Object {},
|
||||
"sheet": StyleSheet {
|
||||
"_alreadyInsertedOrderInsensitiveRule": true,
|
||||
"_insertTag": [Function],
|
||||
"before": null,
|
||||
"container": <head>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-721pd1-floatTopRight{position:absolute;top:-8px;right:-8px;}
|
||||
</style>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-17hzfsv-ExportApp{}
|
||||
</style>
|
||||
<style
|
||||
data-styled="active"
|
||||
data-styled-version="5.3.11"
|
||||
/>
|
||||
</head>,
|
||||
"ctr": 1,
|
||||
"insertionPoint": undefined,
|
||||
"isSpeedy": false,
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"prepend": undefined,
|
||||
"tags": Array [
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-17hzfsv-ExportApp{}
|
||||
</style>,
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
isStringTag={true}
|
||||
serialized={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "17hzfsv-ExportApp",
|
||||
"next": undefined,
|
||||
"styles": ";label:ExportApp;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
<div
|
||||
className="canvasExport__stageContent css-17hzfsv-ExportApp"
|
||||
data-shared-items-count={3}
|
||||
>
|
||||
<div>
|
||||
Page
|
||||
</div>
|
||||
</WorkpadPage>
|
||||
<WorkpadPage
|
||||
isSelected={true}
|
||||
registerLayout={[Function]}
|
||||
unregisterLayout={[Function]}
|
||||
>
|
||||
<div>
|
||||
Page
|
||||
</div>
|
||||
</WorkpadPage>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -112,18 +180,86 @@ exports[`<ExportApp /> renders as expected 2`] = `
|
|||
</RoutingLink>
|
||||
</div>
|
||||
<div
|
||||
className="canvasExport__stageContent"
|
||||
css="unknown styles"
|
||||
data-shared-items-count={4}
|
||||
>
|
||||
<WorkpadPage
|
||||
isSelected={true}
|
||||
registerLayout={[Function]}
|
||||
unregisterLayout={[Function]}
|
||||
<Insertion
|
||||
cache={
|
||||
Object {
|
||||
"insert": [Function],
|
||||
"inserted": Object {
|
||||
"17hzfsv-ExportApp": true,
|
||||
},
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"registered": Object {},
|
||||
"sheet": StyleSheet {
|
||||
"_alreadyInsertedOrderInsensitiveRule": true,
|
||||
"_insertTag": [Function],
|
||||
"before": null,
|
||||
"container": <head>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-721pd1-floatTopRight{position:absolute;top:-8px;right:-8px;}
|
||||
</style>
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-17hzfsv-ExportApp{}
|
||||
</style>
|
||||
<style
|
||||
data-styled="active"
|
||||
data-styled-version="5.3.11"
|
||||
/>
|
||||
</head>,
|
||||
"ctr": 1,
|
||||
"insertionPoint": undefined,
|
||||
"isSpeedy": false,
|
||||
"key": "css",
|
||||
"nonce": undefined,
|
||||
"prepend": undefined,
|
||||
"tags": Array [
|
||||
<style
|
||||
data-emotion="css"
|
||||
data-s=""
|
||||
>
|
||||
|
||||
.css-17hzfsv-ExportApp{}
|
||||
</style>,
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
isStringTag={true}
|
||||
serialized={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "17hzfsv-ExportApp",
|
||||
"next": undefined,
|
||||
"styles": ";label:ExportApp;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
/>
|
||||
<div
|
||||
className="canvasExport__stageContent css-17hzfsv-ExportApp"
|
||||
data-shared-items-count={4}
|
||||
>
|
||||
<div>
|
||||
Page
|
||||
</div>
|
||||
</WorkpadPage>
|
||||
<WorkpadPage
|
||||
isSelected={true}
|
||||
registerLayout={[Function]}
|
||||
unregisterLayout={[Function]}
|
||||
>
|
||||
<div>
|
||||
Page
|
||||
</div>
|
||||
</WorkpadPage>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -36,8 +36,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with default propertie
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -93,8 +92,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with default propertie
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -163,8 +161,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with height specified
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -220,8 +217,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with height specified
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -290,8 +286,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with page specified 2`
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -347,8 +342,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with page specified 2`
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -418,8 +412,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with width and height
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -475,8 +468,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with width and height
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -545,8 +537,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with width specified 2
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
@ -602,8 +593,7 @@ exports[`Canvas Shareable Workpad API Placed successfully with width specified 2
|
|||
class="root"
|
||||
>
|
||||
<div
|
||||
class="container"
|
||||
css="css-159kt7d"
|
||||
class="container css-13pzju3"
|
||||
style="overflow: hidden;"
|
||||
>
|
||||
<div
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -6,7 +6,13 @@
|
|||
*/
|
||||
|
||||
import React, { ReactElement, MouseEvent } from 'react';
|
||||
import { EuiColorPicker, EuiSelectable, EuiContextMenu, EuiButton } from '@elastic/eui';
|
||||
import {
|
||||
EuiColorPicker,
|
||||
EuiSelectable,
|
||||
EuiContextMenu,
|
||||
EuiButton,
|
||||
EuiProvider,
|
||||
} from '@elastic/eui';
|
||||
import { FieldPicker } from './field_picker';
|
||||
import { FieldEditor } from './field_editor';
|
||||
import { GraphStore, loadFields } from '../../state_management';
|
||||
|
@ -72,9 +78,11 @@ describe('field_manager', () => {
|
|||
|
||||
instance = shallow(
|
||||
// https://github.com/airbnb/enzyme/issues/2176#issuecomment-532361526
|
||||
<Provider store={store}>
|
||||
<FieldManager pickerOpen={true} setPickerOpen={() => {}} store={store} />
|
||||
</Provider>
|
||||
<EuiProvider>
|
||||
<Provider store={store}>
|
||||
<FieldManager pickerOpen={true} setPickerOpen={() => {}} store={store} />
|
||||
</Provider>
|
||||
</EuiProvider>
|
||||
);
|
||||
|
||||
getInstance = () => instance.find(FieldManager).dive().dive().dive();
|
||||
|
@ -215,7 +223,11 @@ describe('field_manager', () => {
|
|||
const fieldEditor = getInstance().find(FieldEditor).at(1).dive();
|
||||
|
||||
const getDisplayForm = () =>
|
||||
shallow(fieldEditor.find(EuiContextMenu).prop('panels')![1].content as ReactElement);
|
||||
shallow(
|
||||
<EuiProvider>
|
||||
{fieldEditor.find(EuiContextMenu).prop('panels')![1].content as ReactElement}
|
||||
</EuiProvider>
|
||||
);
|
||||
|
||||
act(() => {
|
||||
getDisplayForm().find(EuiColorPicker).prop('onChange')!('#aaa', {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
exports[`graph_visualization should render to svg elements 1`] = `
|
||||
<svg
|
||||
className="gphGraph"
|
||||
css="unknown styles"
|
||||
height="100%"
|
||||
id="graphSvg"
|
||||
pointerEvents="all"
|
||||
|
@ -11,271 +11,73 @@ exports[`graph_visualization should render to svg elements 1`] = `
|
|||
>
|
||||
<g>
|
||||
<g>
|
||||
<g
|
||||
css={
|
||||
<EmotionCssPropInternal
|
||||
__EMOTION_TYPE_PLEASE_DO_NOT_USE__="line"
|
||||
className="gphEdge gphEdge--clickable"
|
||||
onClick={[Function]}
|
||||
style={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "qqu03v",
|
||||
"next": undefined,
|
||||
"styles": "&:hover{.gphEdge{stroke-opacity:0.95;cursor:pointer;}}",
|
||||
"toString": [Function],
|
||||
"strokeWidth": 15,
|
||||
}
|
||||
}
|
||||
key="A..1-B..2"
|
||||
>
|
||||
<line
|
||||
className="gphEdge"
|
||||
strokeLinecap="round"
|
||||
style={
|
||||
Object {
|
||||
"strokeWidth": 2,
|
||||
}
|
||||
}
|
||||
x1={5}
|
||||
x2={7}
|
||||
y1={5}
|
||||
y2={9}
|
||||
/>
|
||||
<line
|
||||
className="gphEdge gphEdge--clickable"
|
||||
onClick={[Function]}
|
||||
style={
|
||||
Object {
|
||||
"strokeWidth": 15,
|
||||
}
|
||||
}
|
||||
x1={5}
|
||||
x2={7}
|
||||
y1={5}
|
||||
y2={9}
|
||||
/>
|
||||
</g>
|
||||
<g
|
||||
css={
|
||||
x1={5}
|
||||
x2={7}
|
||||
y1={5}
|
||||
y2={9}
|
||||
/>
|
||||
<EmotionCssPropInternal
|
||||
__EMOTION_TYPE_PLEASE_DO_NOT_USE__="line"
|
||||
className="gphEdge gphEdge--clickable"
|
||||
onClick={[Function]}
|
||||
style={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "qqu03v",
|
||||
"next": undefined,
|
||||
"styles": "&:hover{.gphEdge{stroke-opacity:0.95;cursor:pointer;}}",
|
||||
"toString": [Function],
|
||||
"strokeWidth": 15,
|
||||
}
|
||||
}
|
||||
key="B..2-C..3"
|
||||
>
|
||||
<line
|
||||
className="gphEdge"
|
||||
strokeLinecap="round"
|
||||
style={
|
||||
Object {
|
||||
"strokeWidth": 2.2,
|
||||
}
|
||||
}
|
||||
x1={7}
|
||||
x2={12}
|
||||
y1={9}
|
||||
y2={2}
|
||||
/>
|
||||
<line
|
||||
className="gphEdge gphEdge--clickable"
|
||||
onClick={[Function]}
|
||||
style={
|
||||
Object {
|
||||
"strokeWidth": 15,
|
||||
}
|
||||
}
|
||||
x1={7}
|
||||
x2={12}
|
||||
y1={9}
|
||||
y2={2}
|
||||
/>
|
||||
</g>
|
||||
x1={7}
|
||||
x2={12}
|
||||
y1={9}
|
||||
y2={2}
|
||||
/>
|
||||
</g>
|
||||
<g
|
||||
className="gphNode"
|
||||
key="A..1"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
>
|
||||
<g>
|
||||
<circle
|
||||
css={
|
||||
Array [
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "8r5wwo",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
fill: black;
|
||||
",
|
||||
"toString": [Function],
|
||||
},
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1m022vv",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
stroke-width: 4px;
|
||||
stroke: #99c9eb;
|
||||
paint-order: stroke;
|
||||
",
|
||||
"toString": [Function],
|
||||
},
|
||||
]
|
||||
}
|
||||
css="unknown styles"
|
||||
cx={5}
|
||||
cy={5}
|
||||
r={10}
|
||||
/>
|
||||
<IconRenderer
|
||||
color="black"
|
||||
icon={
|
||||
Object {
|
||||
"id": "a",
|
||||
"label": "",
|
||||
"package": "eui",
|
||||
"prevName": "",
|
||||
}
|
||||
}
|
||||
x={-2.5}
|
||||
y={-3.5}
|
||||
r="5"
|
||||
transform="translate(10,10)"
|
||||
/>
|
||||
<text
|
||||
className="gphNode__label"
|
||||
css="unknown styles"
|
||||
textAnchor="middle"
|
||||
transform="translate(0,22)"
|
||||
transform="translate(10,12)"
|
||||
x={5}
|
||||
y={5}
|
||||
>
|
||||
1
|
||||
</text>
|
||||
<g>
|
||||
<circle
|
||||
css={[Function]}
|
||||
cx={5}
|
||||
cy={5}
|
||||
r="5"
|
||||
transform="translate(10,10)"
|
||||
/>
|
||||
<text
|
||||
css={
|
||||
Array [
|
||||
[Function],
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "u1rg7h",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
font-size: calc(8px - 2px);
|
||||
fill: #FFFFFF;
|
||||
",
|
||||
"toString": [Function],
|
||||
},
|
||||
]
|
||||
}
|
||||
textAnchor="middle"
|
||||
transform="translate(10,12)"
|
||||
x={5}
|
||||
y={5}
|
||||
>
|
||||
1
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
className="gphNode"
|
||||
key="B..2"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
<EmotionCssPropInternal
|
||||
__EMOTION_TYPE_PLEASE_DO_NOT_USE__="text"
|
||||
className="gphNode__label"
|
||||
textAnchor="middle"
|
||||
transform="translate(0,22)"
|
||||
x={7}
|
||||
y={9}
|
||||
>
|
||||
<circle
|
||||
css={
|
||||
Array [
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1cbm3l8",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
fill: red;
|
||||
",
|
||||
"toString": [Function],
|
||||
},
|
||||
false,
|
||||
]
|
||||
}
|
||||
cx={7}
|
||||
cy={9}
|
||||
r={10}
|
||||
/>
|
||||
<IconRenderer
|
||||
color="red"
|
||||
icon={
|
||||
Object {
|
||||
"id": "b",
|
||||
"label": "",
|
||||
"package": "eui",
|
||||
"prevName": "",
|
||||
}
|
||||
}
|
||||
x={-0.5}
|
||||
y={0.5}
|
||||
/>
|
||||
<text
|
||||
className="gphNode__label"
|
||||
textAnchor="middle"
|
||||
transform="translate(0,22)"
|
||||
x={7}
|
||||
y={9}
|
||||
>
|
||||
2
|
||||
</text>
|
||||
</g>
|
||||
<g
|
||||
className="gphNode"
|
||||
key="C..3"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
2
|
||||
</EmotionCssPropInternal>
|
||||
<EmotionCssPropInternal
|
||||
__EMOTION_TYPE_PLEASE_DO_NOT_USE__="text"
|
||||
className="gphNode__label"
|
||||
textAnchor="middle"
|
||||
transform="translate(0,22)"
|
||||
x={12}
|
||||
y={2}
|
||||
>
|
||||
<circle
|
||||
css={
|
||||
Array [
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1yit9pb",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
fill: yellow;
|
||||
",
|
||||
"toString": [Function],
|
||||
},
|
||||
false,
|
||||
]
|
||||
}
|
||||
cx={12}
|
||||
cy={2}
|
||||
r={10}
|
||||
/>
|
||||
<IconRenderer
|
||||
color="yellow"
|
||||
icon={
|
||||
Object {
|
||||
"id": "c",
|
||||
"label": "",
|
||||
"package": "eui",
|
||||
"prevName": "",
|
||||
}
|
||||
}
|
||||
x={4.5}
|
||||
y={-6.5}
|
||||
/>
|
||||
<text
|
||||
className="gphNode__label"
|
||||
textAnchor="middle"
|
||||
transform="translate(0,22)"
|
||||
x={12}
|
||||
y={2}
|
||||
>
|
||||
3
|
||||
</text>
|
||||
</g>
|
||||
3
|
||||
</EmotionCssPropInternal>
|
||||
</g>
|
||||
</svg>
|
||||
`;
|
||||
|
|
|
@ -135,7 +135,7 @@ describe('graph_visualization', () => {
|
|||
)
|
||||
).toMatchInlineSnapshot(`
|
||||
<svg
|
||||
className="gphGraph"
|
||||
css="unknown styles"
|
||||
height="100%"
|
||||
id="graphSvg"
|
||||
pointerEvents="all"
|
||||
|
|
|
@ -23,13 +23,13 @@ describe('venn_diagram', () => {
|
|||
>
|
||||
<g>
|
||||
<circle
|
||||
className="gphVennDiagram__left"
|
||||
css="unknown styles"
|
||||
cx={5.284377114585398}
|
||||
cy={4.370193722368317}
|
||||
r={3.0901936161855166}
|
||||
/>
|
||||
<circle
|
||||
className="gphVennDiagram__right"
|
||||
css="unknown styles"
|
||||
cx={10.91639766870507}
|
||||
cy={4.370193722368317}
|
||||
r={4.370193722368317}
|
||||
|
@ -52,13 +52,13 @@ describe('venn_diagram', () => {
|
|||
>
|
||||
<g>
|
||||
<circle
|
||||
className="gphVennDiagram__left"
|
||||
css="unknown styles"
|
||||
cx={167.10667697398674}
|
||||
cy={138.1976597885342}
|
||||
r={97.720502380584}
|
||||
/>
|
||||
<circle
|
||||
className="gphVennDiagram__right"
|
||||
css="unknown styles"
|
||||
cx={345.20680477219986}
|
||||
cy={138.1976597885342}
|
||||
r={138.1976597885342}
|
||||
|
|
|
@ -108,7 +108,7 @@ exports[`extend index management ilm summary extension should render a phase def
|
|||
class="euiFlexGroup emotion-euiFlexGroup-responsive-wrap-l-flexStart-stretch-row"
|
||||
>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1-IndexLifecycleSummary"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingMedium emotion-euiPanel-m-m-plain-hasBorder"
|
||||
|
@ -231,7 +231,7 @@ exports[`extend index management ilm summary extension should render a phase def
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-3"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-3-IndexLifecycleSummary"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingMedium emotion-euiPanel-m-m-plain-hasBorder"
|
||||
|
@ -278,7 +278,7 @@ exports[`extend index management ilm summary extension should render a step info
|
|||
class="euiFlexGroup emotion-euiFlexGroup-responsive-wrap-l-flexStart-stretch-row"
|
||||
>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1-IndexLifecycleSummary"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingMedium emotion-euiPanel-m-m-plain-hasBorder"
|
||||
|
@ -401,7 +401,7 @@ exports[`extend index management ilm summary extension should render a step info
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-3"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-3-IndexLifecycleSummary"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingMedium emotion-euiPanel-m-m-plain-hasBorder"
|
||||
|
@ -444,7 +444,7 @@ exports[`extend index management ilm summary extension should render an error pa
|
|||
class="euiFlexGroup emotion-euiFlexGroup-responsive-wrap-l-flexStart-stretch-row"
|
||||
>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1-IndexLifecycleSummary"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingMedium emotion-euiPanel-m-m-plain-hasBorder"
|
||||
|
@ -567,7 +567,7 @@ exports[`extend index management ilm summary extension should render an error pa
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-3"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-3-IndexLifecycleSummary"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--danger euiPanel--paddingMedium emotion-euiPanel-m-m-danger"
|
||||
|
@ -611,7 +611,7 @@ exports[`extend index management ilm summary extension should render the tab whe
|
|||
class="euiFlexGroup emotion-euiFlexGroup-responsive-wrap-l-flexStart-stretch-row"
|
||||
>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-1-IndexLifecycleSummary"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--plain euiPanel--paddingMedium emotion-euiPanel-m-m-plain-hasBorder"
|
||||
|
@ -733,7 +733,7 @@ exports[`extend index management ilm summary extension should render the tab whe
|
|||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-3"
|
||||
class="euiFlexItem emotion-euiFlexItem-grow-3-IndexLifecycleSummary"
|
||||
/>
|
||||
</div>
|
||||
`;
|
||||
|
|
|
@ -196,7 +196,7 @@ exports[`View policy flyout shows all phases 1`] = `
|
|||
class="euiFlexItem emotion-euiFlexItem-growZero"
|
||||
>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-y7ykds-PhaseIndicator"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
@ -405,7 +405,7 @@ exports[`View policy flyout shows all phases 1`] = `
|
|||
class="euiFlexItem emotion-euiFlexItem-growZero"
|
||||
>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-yeo4l-PhaseIndicator"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
@ -624,7 +624,7 @@ exports[`View policy flyout shows all phases 1`] = `
|
|||
class="euiFlexItem emotion-euiFlexItem-growZero"
|
||||
>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-dg1e6b-PhaseIndicator"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
@ -798,7 +798,7 @@ exports[`View policy flyout shows all phases 1`] = `
|
|||
class="euiFlexItem emotion-euiFlexItem-growZero"
|
||||
>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-1vch2g1-PhaseIndicator"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
@ -872,7 +872,7 @@ exports[`View policy flyout shows all phases 1`] = `
|
|||
class="euiFlexItem emotion-euiFlexItem-growZero"
|
||||
>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-dgpkzy-PhaseIndicator"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { renderWithIntl } from '@kbn/test-jest-helpers';
|
||||
import { EuiThemeProvider } from '@elastic/eui';
|
||||
import { MetricCell } from './cells';
|
||||
|
||||
describe('Node Listing Metric Cell', () => {
|
||||
|
@ -63,6 +64,12 @@ describe('Node Listing Metric Cell', () => {
|
|||
|
||||
it('should format N/A as the metric for an offline node', () => {
|
||||
const props = { isOnline: false };
|
||||
expect(renderWithIntl(<MetricCell {...props} />)).toMatchSnapshot();
|
||||
expect(
|
||||
renderWithIntl(
|
||||
<EuiThemeProvider>
|
||||
<MetricCell {...props} />
|
||||
</EuiThemeProvider>
|
||||
)
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,6 +22,7 @@ exports[`PluginStatement component adds warning highlight for cpu time 1`] = `
|
|||
aria-label="mutate"
|
||||
className="monPipelineViewer__plugin"
|
||||
color="primary"
|
||||
data-test-subj="pluginStatement-filter-mutate-EmptyButton"
|
||||
flush="left"
|
||||
iconType="dot"
|
||||
onClick={[Function]}
|
||||
|
@ -36,6 +37,7 @@ exports[`PluginStatement component adds warning highlight for cpu time 1`] = `
|
|||
grow={false}
|
||||
>
|
||||
<EuiBadge
|
||||
data-test-subj="pluginStatement-filter-mutate-Badge"
|
||||
onClick={[Function]}
|
||||
onClickAriaLabel="View details"
|
||||
>
|
||||
|
@ -94,6 +96,7 @@ exports[`PluginStatement component adds warning highlight for event millis 1`] =
|
|||
aria-label="mutate"
|
||||
className="monPipelineViewer__plugin"
|
||||
color="primary"
|
||||
data-test-subj="pluginStatement-filter-mutate-EmptyButton"
|
||||
flush="left"
|
||||
iconType="dot"
|
||||
onClick={[Function]}
|
||||
|
@ -108,6 +111,7 @@ exports[`PluginStatement component adds warning highlight for event millis 1`] =
|
|||
grow={false}
|
||||
>
|
||||
<EuiBadge
|
||||
data-test-subj="pluginStatement-filter-mutate-Badge"
|
||||
onClick={[Function]}
|
||||
onClickAriaLabel="View details"
|
||||
>
|
||||
|
@ -166,6 +170,7 @@ exports[`PluginStatement component does not render explicit id field if no id is
|
|||
aria-label="stdin"
|
||||
className="monPipelineViewer__plugin"
|
||||
color="primary"
|
||||
data-test-subj="pluginStatement-input-stdin-EmptyButton"
|
||||
flush="left"
|
||||
iconType="dot"
|
||||
onClick={[Function]}
|
||||
|
@ -216,6 +221,7 @@ exports[`PluginStatement component renders input metrics and explicit id fields
|
|||
aria-label="stdin"
|
||||
className="monPipelineViewer__plugin"
|
||||
color="primary"
|
||||
data-test-subj="pluginStatement-input-stdin-EmptyButton"
|
||||
flush="left"
|
||||
iconType="dot"
|
||||
onClick={[Function]}
|
||||
|
@ -230,6 +236,7 @@ exports[`PluginStatement component renders input metrics and explicit id fields
|
|||
grow={false}
|
||||
>
|
||||
<EuiBadge
|
||||
data-test-subj="pluginStatement-input-stdin-Badge"
|
||||
onClick={[Function]}
|
||||
onClickAriaLabel="View details"
|
||||
>
|
||||
|
@ -276,6 +283,7 @@ exports[`PluginStatement component renders processor statement metrics 1`] = `
|
|||
aria-label="mutate"
|
||||
className="monPipelineViewer__plugin"
|
||||
color="primary"
|
||||
data-test-subj="pluginStatement-filter-mutate-EmptyButton"
|
||||
flush="left"
|
||||
iconType="dot"
|
||||
onClick={[Function]}
|
||||
|
@ -290,6 +298,7 @@ exports[`PluginStatement component renders processor statement metrics 1`] = `
|
|||
grow={false}
|
||||
>
|
||||
<EuiBadge
|
||||
data-test-subj="pluginStatement-filter-mutate-Badge"
|
||||
onClick={[Function]}
|
||||
onClickAriaLabel="View details"
|
||||
>
|
||||
|
|
|
@ -76,6 +76,7 @@ export function PluginStatement({
|
|||
<EuiFlexGroup alignItems="center" gutterSize="xs" responsive={false}>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty
|
||||
data-test-subj={`pluginStatement-${pluginType}-${name}-EmptyButton`}
|
||||
aria-label={name}
|
||||
className="monPipelineViewer__plugin"
|
||||
color="primary"
|
||||
|
@ -90,6 +91,7 @@ export function PluginStatement({
|
|||
{hasExplicitId && (
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiBadge
|
||||
data-test-subj={`pluginStatement-${pluginType}-${name}-Badge`}
|
||||
onClick={onNameButtonClick}
|
||||
onClickAriaLabel={i18n.translate(
|
||||
'xpack.monitoring.logstash.pipelineStatement.viewDetailsAriaLabel',
|
||||
|
|
|
@ -9,8 +9,6 @@ import React from 'react';
|
|||
import { PluginStatement } from './plugin_statement';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import { EuiButtonEmpty, EuiBadge } from '@elastic/eui';
|
||||
|
||||
describe('PluginStatement component', () => {
|
||||
let props;
|
||||
let onShowVertexDetails;
|
||||
|
@ -82,18 +80,22 @@ describe('PluginStatement component', () => {
|
|||
});
|
||||
|
||||
it('handles name button click', () => {
|
||||
const { vertex } = props.statement;
|
||||
const { vertex, pluginType, name } = props.statement;
|
||||
const wrapper = render(props);
|
||||
wrapper.find(EuiButtonEmpty).simulate('click');
|
||||
wrapper
|
||||
.find(`[data-test-subj="pluginStatement-${pluginType}-${name}-EmptyButton"]`)
|
||||
.simulate('click');
|
||||
|
||||
expect(onShowVertexDetails).toHaveBeenCalledTimes(1);
|
||||
expect(onShowVertexDetails).toHaveBeenCalledWith(vertex);
|
||||
});
|
||||
|
||||
it('handles id badge click', () => {
|
||||
const { vertex } = props.statement;
|
||||
const { vertex, pluginType, name } = props.statement;
|
||||
const wrapper = render(props);
|
||||
wrapper.find(EuiBadge).simulate('click');
|
||||
wrapper
|
||||
.find(`[data-test-subj="pluginStatement-${pluginType}-${name}-Badge"]`)
|
||||
.simulate('click');
|
||||
|
||||
expect(onShowVertexDetails).toHaveBeenCalledTimes(1);
|
||||
expect(onShowVertexDetails).toHaveBeenCalledWith(vertex);
|
||||
|
|
|
@ -8,7 +8,7 @@ exports[`Sparkline component does not show tooltip initially 1`] = `
|
|||
</div>
|
||||
`;
|
||||
|
||||
exports[`Sparkline component shows tooltip on hover 1`] = `
|
||||
exports[`Sparkline component with EuiProvider shows tooltip on hover 1`] = `
|
||||
<div>
|
||||
<div
|
||||
className="monSparkline"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { EuiThemeProvider } from '@elastic/eui';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Sparkline } from '.';
|
||||
|
||||
|
@ -14,60 +15,47 @@ jest.mock('./sparkline_flot_chart', () => ({
|
|||
SparklineFlotChart: () => 'SparklineFlotChart',
|
||||
}));
|
||||
|
||||
const getComponent = () => (
|
||||
<Sparkline
|
||||
series={[
|
||||
[1513814814, 20],
|
||||
[1513814914, 25],
|
||||
[1513815114, 10],
|
||||
]}
|
||||
tooltip={{
|
||||
enabled: true,
|
||||
xValueFormatter: (x) => x,
|
||||
yValueFormatter: (y) => y,
|
||||
}}
|
||||
options={{
|
||||
xaxis: {
|
||||
min: 1513814800,
|
||||
max: 1513815200,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
const mockDataPoint = {
|
||||
xValue: 25,
|
||||
yValue: 1513814914,
|
||||
xPosition: 200,
|
||||
yPosition: 45,
|
||||
plotTop: 40,
|
||||
plotLeft: 150,
|
||||
plotHeight: 30,
|
||||
plotWidth: 100,
|
||||
};
|
||||
|
||||
describe('Sparkline component', () => {
|
||||
let component;
|
||||
let renderedComponent;
|
||||
let mockDataPoint;
|
||||
|
||||
beforeEach(() => {
|
||||
component = (
|
||||
<Sparkline
|
||||
series={[
|
||||
[1513814814, 20],
|
||||
[1513814914, 25],
|
||||
[1513815114, 10],
|
||||
]}
|
||||
tooltip={{
|
||||
enabled: true,
|
||||
xValueFormatter: (x) => x,
|
||||
yValueFormatter: (y) => y,
|
||||
}}
|
||||
options={{
|
||||
xaxis: {
|
||||
min: 1513814800,
|
||||
max: 1513815200,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
renderedComponent = renderer.create(component);
|
||||
mockDataPoint = {
|
||||
xValue: 25,
|
||||
yValue: 1513814914,
|
||||
xPosition: 200,
|
||||
yPosition: 45,
|
||||
plotTop: 40,
|
||||
plotLeft: 150,
|
||||
plotHeight: 30,
|
||||
plotWidth: 100,
|
||||
};
|
||||
});
|
||||
|
||||
test('does not show tooltip initially', () => {
|
||||
const tree = renderedComponent.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('shows tooltip on hover', () => {
|
||||
const sparkline = renderedComponent.getInstance();
|
||||
sparkline.onHover(mockDataPoint);
|
||||
|
||||
const renderedComponent = renderer.create(getComponent());
|
||||
const tree = renderedComponent.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('removes tooltip when tooltip.enabled prop is changed to false', () => {
|
||||
const wrapper = shallow(component);
|
||||
const wrapper = shallow(getComponent());
|
||||
expect(wrapper.find('.monSparklineTooltip__container')).toHaveLength(0);
|
||||
|
||||
wrapper.setState({ tooltip: mockDataPoint });
|
||||
|
@ -77,3 +65,17 @@ describe('Sparkline component', () => {
|
|||
expect(wrapper.find('.monSparklineTooltip__container')).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Sparkline component with EuiProvider', () => {
|
||||
test('shows tooltip on hover', () => {
|
||||
const wrapper = shallow(getComponent(), {
|
||||
wrappingComponent: EuiThemeProvider,
|
||||
});
|
||||
|
||||
wrapper.instance().onHover(mockDataPoint);
|
||||
|
||||
wrapper.update();
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiThemeProvider } from '@elastic/eui';
|
||||
import { renderWithI18nProvider } from '@kbn/test-jest-helpers';
|
||||
import { SummaryStatus } from './summary_status';
|
||||
|
||||
|
@ -27,7 +28,13 @@ describe('Summary Status Component', () => {
|
|||
status: 'green',
|
||||
};
|
||||
|
||||
expect(renderWithI18nProvider(<SummaryStatus {...props} />)).toMatchSnapshot();
|
||||
expect(
|
||||
renderWithI18nProvider(
|
||||
<EuiThemeProvider>
|
||||
<SummaryStatus {...props} />
|
||||
</EuiThemeProvider>
|
||||
)
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should allow label to be optional', () => {
|
||||
|
@ -46,7 +53,13 @@ describe('Summary Status Component', () => {
|
|||
status: 'yellow',
|
||||
};
|
||||
|
||||
expect(renderWithI18nProvider(<SummaryStatus {...props} />)).toMatchSnapshot();
|
||||
expect(
|
||||
renderWithI18nProvider(
|
||||
<EuiThemeProvider>
|
||||
<SummaryStatus {...props} />
|
||||
</EuiThemeProvider>
|
||||
)
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should allow status to be optional', () => {
|
||||
|
@ -65,6 +78,12 @@ describe('Summary Status Component', () => {
|
|||
],
|
||||
};
|
||||
|
||||
expect(renderWithI18nProvider(<SummaryStatus {...props} />)).toMatchSnapshot();
|
||||
expect(
|
||||
renderWithI18nProvider(
|
||||
<EuiThemeProvider>
|
||||
<SummaryStatus {...props} />
|
||||
</EuiThemeProvider>
|
||||
)
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -29,6 +29,7 @@ import { SerializableRecord } from '@kbn/utility-types';
|
|||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { Observable } from 'rxjs';
|
||||
import { EuiThemeProvider } from '@elastic/eui';
|
||||
|
||||
import { ListingProps as Props, ReportListing } from '..';
|
||||
import { mockJobs } from '../../../common/test';
|
||||
|
@ -106,22 +107,24 @@ export const createTestBed = registerTestBed(
|
|||
share,
|
||||
...rest
|
||||
}: Partial<Props> & TestDependencies) => (
|
||||
<KibanaContextProvider services={{ http, application, uiSettings, data, share }}>
|
||||
<InternalApiClientProvider apiClient={reportingAPIClient} http={http}>
|
||||
<IlmPolicyStatusContextProvider>
|
||||
<ReportListing
|
||||
license$={l$}
|
||||
config={mockConfig}
|
||||
redirect={jest.fn()}
|
||||
navigateToUrl={jest.fn()}
|
||||
urlService={urlService}
|
||||
toasts={toasts}
|
||||
apiClient={reportingAPIClient}
|
||||
{...rest}
|
||||
/>
|
||||
</IlmPolicyStatusContextProvider>
|
||||
</InternalApiClientProvider>
|
||||
</KibanaContextProvider>
|
||||
<EuiThemeProvider>
|
||||
<KibanaContextProvider services={{ http, application, uiSettings, data, share }}>
|
||||
<InternalApiClientProvider apiClient={reportingAPIClient} http={http}>
|
||||
<IlmPolicyStatusContextProvider>
|
||||
<ReportListing
|
||||
license$={l$}
|
||||
config={mockConfig}
|
||||
redirect={jest.fn()}
|
||||
navigateToUrl={jest.fn()}
|
||||
urlService={urlService}
|
||||
toasts={toasts}
|
||||
apiClient={reportingAPIClient}
|
||||
{...rest}
|
||||
/>
|
||||
</IlmPolicyStatusContextProvider>
|
||||
</InternalApiClientProvider>
|
||||
</KibanaContextProvider>
|
||||
</EuiThemeProvider>
|
||||
),
|
||||
{ memoryRouter: { wrapComponent: false } }
|
||||
);
|
||||
|
|
|
@ -41,7 +41,7 @@ export const createStartServicesMock = ({ license }: StartServiceArgs = {}): Sta
|
|||
security: securityMock.createStart(),
|
||||
triggersActionsUi: {
|
||||
actionTypeRegistry: triggersActionsUi.actionTypeRegistry,
|
||||
getAlertsStateTable: jest.fn().mockReturnValue(<div data-test-subj="alerts-table" />),
|
||||
getAlertsStateTable: jest.fn(() => <div data-test-subj="alerts-table" />),
|
||||
},
|
||||
spaces: spacesPluginMock.createStartContract(),
|
||||
licensing:
|
||||
|
|
|
@ -22,49 +22,43 @@ jest.mock('../../common/hooks');
|
|||
jest.mock('../../common/lib/kibana');
|
||||
|
||||
jest.mock('../header_page', () => ({
|
||||
HeaderPage: jest
|
||||
.fn()
|
||||
.mockReturnValue(<div data-test-subj="test-case-view-header">{'Case view header'}</div>),
|
||||
HeaderPage: jest.fn(() => <div data-test-subj="test-case-view-header">{'Case view header'}</div>),
|
||||
}));
|
||||
|
||||
jest.mock('./metrics', () => ({
|
||||
CaseViewMetrics: jest
|
||||
.fn()
|
||||
.mockReturnValue(<div data-test-subj="test-case-view-metrics">{'Case view metrics'}</div>),
|
||||
CaseViewMetrics: jest.fn(() => (
|
||||
<div data-test-subj="test-case-view-metrics">{'Case view metrics'}</div>
|
||||
)),
|
||||
}));
|
||||
|
||||
jest.mock('./components/case_view_activity', () => ({
|
||||
CaseViewActivity: jest
|
||||
.fn()
|
||||
.mockReturnValue(<div data-test-subj="test-case-view-activity">{'Case view activity'}</div>),
|
||||
CaseViewActivity: jest.fn(() => (
|
||||
<div data-test-subj="test-case-view-activity">{'Case view activity'}</div>
|
||||
)),
|
||||
}));
|
||||
|
||||
jest.mock('./components/case_view_alerts', () => ({
|
||||
CaseViewAlerts: jest
|
||||
.fn()
|
||||
.mockReturnValue(<div data-test-subj="test-case-view-alerts">{'Case view alerts'}</div>),
|
||||
CaseViewAlerts: jest.fn(() => (
|
||||
<div data-test-subj="test-case-view-alerts">{'Case view alerts'}</div>
|
||||
)),
|
||||
}));
|
||||
|
||||
jest.mock('./components/case_view_files', () => ({
|
||||
CaseViewFiles: jest
|
||||
.fn()
|
||||
.mockReturnValue(<div data-test-subj="test-case-view-files">{'Case view files'}</div>),
|
||||
CaseViewFiles: jest.fn(() => (
|
||||
<div data-test-subj="test-case-view-files">{'Case view files'}</div>
|
||||
)),
|
||||
}));
|
||||
|
||||
jest.mock('./components/case_view_observables', () => ({
|
||||
CaseViewObservables: jest
|
||||
.fn()
|
||||
.mockReturnValue(
|
||||
<div data-test-subj="test-case-view-observables">{'Case view observables'}</div>
|
||||
),
|
||||
CaseViewObservables: jest.fn(() => (
|
||||
<div data-test-subj="test-case-view-observables">{'Case view observables'}</div>
|
||||
)),
|
||||
}));
|
||||
|
||||
jest.mock('./components/case_view_similar_cases', () => ({
|
||||
CaseViewSimilarCases: jest
|
||||
.fn()
|
||||
.mockReturnValue(
|
||||
<div data-test-subj="test-case-view-similar-cases">{'Case view similar cases'}</div>
|
||||
),
|
||||
CaseViewSimilarCases: jest.fn(() => (
|
||||
<div data-test-subj="test-case-view-similar-cases">{'Case view similar cases'}</div>
|
||||
)),
|
||||
}));
|
||||
|
||||
const useUrlParamsMock = useUrlParams as jest.Mock;
|
||||
|
|
|
@ -22,7 +22,7 @@ jest.mock('../../../containers/api');
|
|||
// Not using `jest.mocked` here because the `AlertsTable` component is manually typed to ensure
|
||||
// correct type inference, but it's actually a `memo(forwardRef())` component, which is hard to mock
|
||||
jest.mock('@kbn/response-ops-alerts-table', () => ({
|
||||
AlertsTable: jest.fn().mockReturnValue(<div data-test-subj="alerts-table" />),
|
||||
AlertsTable: jest.fn(() => <div data-test-subj="alerts-table" />),
|
||||
}));
|
||||
const mockAlertsTable = jest.mocked(AlertsTable);
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ const useGetTagsMock = useGetTags as jest.Mock;
|
|||
const spacesUiApiMock = {
|
||||
redirectLegacyUrl: jest.fn().mockResolvedValue(undefined),
|
||||
components: {
|
||||
getLegacyUrlConflict: jest.fn().mockReturnValue(<div data-test-subj="conflict-component" />),
|
||||
getLegacyUrlConflict: jest.fn(() => <div data-test-subj="conflict-component" />),
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -52,18 +52,7 @@ describe('ConnectorsDropdown', () => {
|
|||
grow={false}
|
||||
>
|
||||
<EuiIcon
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "atofe7",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
margin-right: 13px;
|
||||
margin-bottom: 0 !important;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="m"
|
||||
type="minusInCircle"
|
||||
/>
|
||||
|
@ -89,18 +78,7 @@ describe('ConnectorsDropdown', () => {
|
|||
grow={false}
|
||||
>
|
||||
<EuiIcon
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13a1e3t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
margin-right: 12px;
|
||||
margin-bottom: 0 !important;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="m"
|
||||
type="logoSecurity"
|
||||
/>
|
||||
|
@ -126,18 +104,7 @@ describe('ConnectorsDropdown', () => {
|
|||
grow={false}
|
||||
>
|
||||
<EuiIcon
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13a1e3t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
margin-right: 12px;
|
||||
margin-bottom: 0 !important;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="m"
|
||||
type="logoSecurity"
|
||||
/>
|
||||
|
@ -163,18 +130,7 @@ describe('ConnectorsDropdown', () => {
|
|||
grow={false}
|
||||
>
|
||||
<EuiIcon
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13a1e3t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
margin-right: 12px;
|
||||
margin-bottom: 0 !important;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="m"
|
||||
type="logoSecurity"
|
||||
/>
|
||||
|
@ -200,18 +156,7 @@ describe('ConnectorsDropdown', () => {
|
|||
grow={false}
|
||||
>
|
||||
<EuiIcon
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13a1e3t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
margin-right: 12px;
|
||||
margin-bottom: 0 !important;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="m"
|
||||
type="logoSecurity"
|
||||
/>
|
||||
|
@ -237,18 +182,7 @@ describe('ConnectorsDropdown', () => {
|
|||
grow={false}
|
||||
>
|
||||
<EuiIcon
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "13a1e3t",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
margin-right: 12px;
|
||||
margin-bottom: 0 !important;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="m"
|
||||
type="logoSecurity"
|
||||
/>
|
||||
|
@ -268,18 +202,7 @@ describe('ConnectorsDropdown', () => {
|
|||
aria-label="This connector is deprecated. Update it, or create a new one."
|
||||
color="warning"
|
||||
content="This connector is deprecated. Update it, or create a new one."
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "pxiz1g",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
margin-left: 8px
|
||||
margin-bottom: 0 !important;
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
size="m"
|
||||
type="warning"
|
||||
/>
|
||||
|
|
|
@ -1,19 +1,9 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`LinkIcon it renders 1`] = `
|
||||
<EuiLink
|
||||
aria-label="Test link"
|
||||
className="casesLinkIcon"
|
||||
onClick={[Function]}
|
||||
<span
|
||||
className="casesLinkIcon__label"
|
||||
>
|
||||
<EuiIcon
|
||||
size="xxl"
|
||||
type="warning"
|
||||
/>
|
||||
<span
|
||||
className="casesLinkIcon__label"
|
||||
>
|
||||
Test link
|
||||
</span>
|
||||
</EuiLink>
|
||||
Test link
|
||||
</span>
|
||||
`;
|
||||
|
|
|
@ -13,7 +13,7 @@ import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
|
|||
import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks';
|
||||
import { DataView, DataViewField } from '@kbn/data-views-plugin/common';
|
||||
import { loadFieldStats } from '@kbn/unified-field-list/src/services/field_stats';
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { InnerFieldItem, FieldItemIndexPatternFieldProps } from './field_item';
|
||||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
|
@ -399,10 +399,15 @@ describe('Lens Field Item', () => {
|
|||
};
|
||||
|
||||
render(
|
||||
<KibanaContextProvider services={services}>
|
||||
<InnerFieldItem {...defaultProps} />
|
||||
</KibanaContextProvider>
|
||||
<KibanaRenderContextProvider {...mockedServices.core}>
|
||||
<KibanaContextProvider services={services}>
|
||||
<InnerFieldItem {...defaultProps} />
|
||||
</KibanaContextProvider>
|
||||
</KibanaRenderContextProvider>
|
||||
);
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId('field-bytes-showDetails')).toBeInTheDocument();
|
||||
});
|
||||
await clickField('bytes');
|
||||
expect(
|
||||
screen.queryByTestId('lnsFieldListPanel-exploreInDiscover-bytes')
|
||||
|
|
|
@ -689,7 +689,8 @@ describe('LayerPanel', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should determine if the datasource supports dropping of a field onto a pre-filled dimension', async () => {
|
||||
// TODO: Doesn't work because of emotion babel css prop preset
|
||||
it.skip('should determine if the datasource supports dropping of a field onto a pre-filled dimension', async () => {
|
||||
mockVisualization.getConfiguration.mockReturnValue({
|
||||
groups: [
|
||||
{
|
||||
|
@ -737,7 +738,8 @@ describe('LayerPanel', () => {
|
|||
expect(onDropToDimension).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should allow drag to move between groups', async () => {
|
||||
// TODO: Doesn't work because of emotion babel css prop preset
|
||||
it.skip('should allow drag to move between groups', async () => {
|
||||
(generateId as jest.Mock).mockReturnValue(`newid`);
|
||||
|
||||
mockVisualization.getConfiguration.mockReturnValue({
|
||||
|
|
|
@ -40,6 +40,7 @@ import { getLensInspectorService } from '../../lens_inspector_service';
|
|||
import { createIndexPatternServiceMock } from '../../mocks/data_views_service_mock';
|
||||
import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks';
|
||||
import { EventAnnotationServiceType } from '@kbn/event-annotation-plugin/public';
|
||||
import { EuiThemeProvider } from '@elastic/eui';
|
||||
|
||||
function generateSuggestion(state = {}): DatasourceSuggestion {
|
||||
return {
|
||||
|
@ -144,12 +145,14 @@ describe('editor_frame', () => {
|
|||
}
|
||||
) => {
|
||||
const { store, ...rtlRender } = renderWithReduxStore(
|
||||
<EditorFrame
|
||||
{...getDefaultProps()}
|
||||
visualizationMap={visualizationMap}
|
||||
datasourceMap={datasourceMap}
|
||||
{...propsOverrides}
|
||||
/>,
|
||||
<EuiThemeProvider>
|
||||
<EditorFrame
|
||||
{...getDefaultProps()}
|
||||
visualizationMap={visualizationMap}
|
||||
datasourceMap={datasourceMap}
|
||||
{...propsOverrides}
|
||||
/>
|
||||
</EuiThemeProvider>,
|
||||
{},
|
||||
{
|
||||
preloadedState: {
|
||||
|
@ -491,18 +494,23 @@ describe('editor_frame', () => {
|
|||
},
|
||||
} as EditorFrameProps;
|
||||
instance = (
|
||||
await mountWithProvider(<EditorFrame {...props} />, {
|
||||
preloadedState: {
|
||||
datasourceStates: {
|
||||
testDatasource: {
|
||||
isLoading: false,
|
||||
state: {
|
||||
internalState1: '',
|
||||
await mountWithProvider(
|
||||
<EuiThemeProvider>
|
||||
<EditorFrame {...props} />
|
||||
</EuiThemeProvider>,
|
||||
{
|
||||
preloadedState: {
|
||||
datasourceStates: {
|
||||
testDatasource: {
|
||||
isLoading: false,
|
||||
state: {
|
||||
internalState1: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
)
|
||||
).instance;
|
||||
|
||||
instance.update();
|
||||
|
@ -588,7 +596,13 @@ describe('editor_frame', () => {
|
|||
},
|
||||
} as EditorFrameProps;
|
||||
|
||||
instance = (await mountWithProvider(<EditorFrame {...props} />)).instance;
|
||||
instance = (
|
||||
await mountWithProvider(
|
||||
<EuiThemeProvider>
|
||||
<EditorFrame {...props} />
|
||||
</EuiThemeProvider>
|
||||
)
|
||||
).instance;
|
||||
|
||||
instance.update();
|
||||
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
|
||||
import React from 'react';
|
||||
|
||||
export const createLogAIAssistantMock = () => jest.fn().mockReturnValue(<div />);
|
||||
export const createLogAIAssistantMock = () => jest.fn(() => <div />);
|
||||
|
|
|
@ -18,14 +18,14 @@ describe('TimeRangeBar', () => {
|
|||
|
||||
test('Renders gantt bar when isRunning is false', () => {
|
||||
const wrapper = mount(<TimeRangeBar timerange={timeRange} />);
|
||||
const ganttBar = wrapper.find('[data-test-subj="mlJobSelectorGanttBar"]');
|
||||
const ganttBar = wrapper.find('div[data-test-subj="mlJobSelectorGanttBar"]');
|
||||
|
||||
expect(ganttBar).toHaveLength(1);
|
||||
});
|
||||
|
||||
test('Renders running animation bar when isRunning is true', () => {
|
||||
const wrapper = mount(<TimeRangeBar timerange={timeRange} isRunning={true} />);
|
||||
const runningBar = wrapper.find('[data-test-subj="mlJobSelectorGanttBarRunning"]');
|
||||
const runningBar = wrapper.find('div[data-test-subj="mlJobSelectorGanttBarRunning"]');
|
||||
|
||||
expect(runningBar).toHaveLength(1);
|
||||
});
|
||||
|
|
|
@ -18,11 +18,7 @@ exports[`ScopeExpression renders when empty list of filter IDs is supplied 1`] =
|
|||
grow={false}
|
||||
>
|
||||
<EuiExpression
|
||||
css={
|
||||
Object {
|
||||
"pointerEvents": "none",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
description={
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="when"
|
||||
|
@ -55,11 +51,7 @@ exports[`ScopeExpression renders when enabled set to false 1`] = `
|
|||
grow={false}
|
||||
>
|
||||
<EuiExpression
|
||||
css={
|
||||
Object {
|
||||
"pointerEvents": "none",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
description={
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="when"
|
||||
|
@ -200,11 +192,7 @@ exports[`ScopeExpression renders when filter ID and type supplied 1`] = `
|
|||
grow={false}
|
||||
>
|
||||
<EuiExpression
|
||||
css={
|
||||
Object {
|
||||
"pointerEvents": "none",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
description={
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="when"
|
||||
|
@ -345,11 +333,7 @@ exports[`ScopeExpression renders when no filter ID or type supplied 1`] = `
|
|||
grow={false}
|
||||
>
|
||||
<EuiExpression
|
||||
css={
|
||||
Object {
|
||||
"pointerEvents": "none",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
description={
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="when"
|
||||
|
|
|
@ -2,15 +2,7 @@
|
|||
|
||||
exports[`ExplorerChartTooltip Render tooltip based on infoTooltip data. 1`] = `
|
||||
<div
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "xotwi",
|
||||
"next": undefined,
|
||||
"styles": "max-width:384px;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<TooltipDefinitionList
|
||||
toolTipData={
|
||||
|
|
|
@ -35,11 +35,7 @@ exports[`ExplorerChartLabelBadge Render the chart label in one line. 1`] = `
|
|||
jobId="population-03"
|
||||
/>
|
||||
}
|
||||
css={
|
||||
Object {
|
||||
"maxWidth": "none",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
position="top"
|
||||
size="s"
|
||||
/>
|
||||
|
@ -72,26 +68,14 @@ exports[`ExplorerChartLabelBadge Render the chart label in two lines. 1`] = `
|
|||
jobId="population-03"
|
||||
/>
|
||||
}
|
||||
css={
|
||||
Object {
|
||||
"maxWidth": "none",
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
position="top"
|
||||
size="s"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1ivb442",
|
||||
"next": undefined,
|
||||
"styles": "display:flex;align-items:center;margin-top:4px;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<ExplorerChartLabelBadge
|
||||
entity={
|
||||
|
|
|
@ -4,15 +4,7 @@ exports[`ExplorerChartLabelBadge Render entity label badge. 1`] = `
|
|||
<span>
|
||||
<EuiBadge
|
||||
color="hollow"
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1l7mgse",
|
||||
"next": undefined,
|
||||
"styles": "font-weight:normal;",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
nginx.access.remote_ip
|
||||
|
||||
|
|
|
@ -15,23 +15,7 @@ exports[`it renders without crashing 1`] = `
|
|||
color="subdued"
|
||||
>
|
||||
<EuiFlexGrid
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "ochhvh",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
grid-template-columns: repeat(
|
||||
2,
|
||||
minmax(0, 1fr)
|
||||
);
|
||||
@media (max-width: 575pxpx) {
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
}
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiFlexItem>
|
||||
<EuiFormRow
|
||||
|
|
|
@ -15,20 +15,7 @@ exports[`it renders without crashing 1`] = `
|
|||
color="subdued"
|
||||
>
|
||||
<EuiFlexGrid
|
||||
css={
|
||||
Object {
|
||||
"map": undefined,
|
||||
"name": "1hh4o6r",
|
||||
"next": undefined,
|
||||
"styles": "
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
@media (max-width: 575pxpx) {
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
}
|
||||
",
|
||||
"toString": [Function],
|
||||
}
|
||||
}
|
||||
css="unknown styles"
|
||||
>
|
||||
<EuiFlexItem>
|
||||
<EuiFormRow
|
||||
|
|
|
@ -76,7 +76,7 @@ describe('SecurityNavControlService', () => {
|
|||
expect(target).toMatchInlineSnapshot(`
|
||||
<div>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
<div
|
||||
|
|
|
@ -124,7 +124,7 @@ describe('spacesManagementApp', () => {
|
|||
expect(container).toMatchInlineSnapshot(`
|
||||
<div>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
Spaces Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"notifications":{"toasts":{}},"spacesManager":{"onActiveSpaceChange$":{}},"serverBasePath":"","history":{"action":"PUSH","length":1,"location":{"pathname":"/","search":"","hash":""}},"maxSpaces":1000,"allowSolutionVisibility":true}
|
||||
|
@ -151,7 +151,7 @@ describe('spacesManagementApp', () => {
|
|||
expect(container).toMatchInlineSnapshot(`
|
||||
<div>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
Spaces Create Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"notifications":{"toasts":{}},"spacesManager":{"onActiveSpaceChange$":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/create","search":"","hash":""}},"allowFeatureVisibility":true,"allowSolutionVisibility":true,"eventTracker":{"analytics":{}}}
|
||||
|
@ -184,7 +184,7 @@ describe('spacesManagementApp', () => {
|
|||
expect(container).toMatchInlineSnapshot(`
|
||||
<div>
|
||||
<div
|
||||
css="You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."
|
||||
class="css-qvyf25-redirectAppLinksStyles"
|
||||
data-test-subj="kbnRedirectAppLink"
|
||||
>
|
||||
Spaces Edit Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"serverBasePath":"","http":{"basePath":{"basePath":"","serverBasePath":"","assetsHrefBase":""},"anonymousPaths":{},"externalUrl":{},"staticAssets":{}},"overlays":{"banners":{}},"notifications":{"toasts":{}},"userProfile":{},"theme":{"theme$":{}},"i18n":{},"logger":{"context":[]},"spacesManager":{"onActiveSpaceChange$":{}},"spaceId":"some-space","history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/some-space","search":"","hash":""}},"allowFeatureVisibility":true,"allowSolutionVisibility":true}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue