From b3952a1e874d7005cf1905f1b5d8f64435ed3ed8 Mon Sep 17 00:00:00 2001 From: Lene Gadewoll Date: Wed, 18 Dec 2024 20:20:44 +0100 Subject: [PATCH] test: update tests and snapshots --- .../src/popover/popover.test.tsx | 2 +- .../unsaved_changes_badge.test.tsx.snap | 2 +- ...op_nav_unsaved_changes_badge.test.tsx.snap | 2 +- .../__snapshots__/app.test.tsx.snap | 2 +- .../__snapshots__/settings.test.tsx.snap | 70 ++++++++++++------- .../extend_index_management.test.tsx.snap | 6 +- .../collection_interval.test.js.snap | 2 +- .../heatmap_style_editor.test.tsx.snap | 6 +- .../__snapshots__/prompt_page.test.tsx.snap | 4 +- .../unauthenticated_page.test.tsx.snap | 4 +- .../reset_session_page.test.tsx.snap | 4 +- .../apm/public/hooks/use_breakpoints.test.tsx | 3 +- .../ml_integerations.test.tsx.snap | 2 +- .../__snapshots__/header_menu.test.tsx.snap | 14 ++-- .../__snapshots__/list_header.test.tsx.snap | 14 ++-- .../__snapshots__/menu_items.test.tsx.snap | 28 +++++--- .../test/functional/apps/infra/home_page.ts | 4 +- .../functional/apps/lens/group4/chart_data.ts | 2 +- .../functional/apps/lens/group5/heatmap.ts | 10 +-- 19 files changed, 109 insertions(+), 72 deletions(-) diff --git a/packages/shared-ux/button_toolbar/src/popover/popover.test.tsx b/packages/shared-ux/button_toolbar/src/popover/popover.test.tsx index 695f02194ab56..d4cd612a2d1c9 100644 --- a/packages/shared-ux/button_toolbar/src/popover/popover.test.tsx +++ b/packages/shared-ux/button_toolbar/src/popover/popover.test.tsx @@ -37,7 +37,7 @@ describe('', () => { const button = component.find('EuiButton'); expect(button.prop('color')).toBe('text'); expect(button.prop('css')).toMatchObject({ - backgroundColor: '#FFF', + backgroundColor: '#FFFFFF', border: '1px solid #D3DAE6', color: '#343741', }); diff --git a/src/platform/packages/private/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap b/src/platform/packages/private/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap index 9991c8a2165d0..9103b94e19379 100644 --- a/src/platform/packages/private/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap +++ b/src/platform/packages/private/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap @@ -10,7 +10,7 @@ exports[` should show all menu items 1`] = ` aria-label="View available actions" class="euiBadge emotion-euiBadge-clickable" data-test-subj="unsavedChangesBadge" - style="--euiBadgeBackgroundColor: #F6E58D; --euiBadgeTextColor: #000;" + style="--euiBadgeBackgroundColor: #F6E58D; --euiBadgeTextColor: #000000;" title="test" > App renders properly 1`] = `"
markdown mock
markdown mock

Page level controls

My Canvas Workpad

There is a new region landmark with page level controls at the end of the document.

"`; +exports[` App renders properly 1`] = `"
markdown mock
markdown mock

Page level controls

My Canvas Workpad

There is a new region landmark with page level controls at the end of the document.

"`; diff --git a/x-pack/platform/plugins/private/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap b/x-pack/platform/plugins/private/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap index cfe41427b1ea1..3ac5a1a2731bc 100644 --- a/x-pack/platform/plugins/private/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap +++ b/x-pack/platform/plugins/private/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap @@ -14,14 +14,18 @@ exports[` can navigate Autoplay Settings 1`] = ` class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" - style="top: -16px; left: -22px; will-change: transform, opacity; z-index: 2000;" + style="top: -16px; left: -18px; will-change: transform, opacity; z-index: 2000;" tabindex="0" >
+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; top: 100%;" + > +
+

can navigate Autoplay Settings 2`] = ` data-popover-open="true" data-popover-panel="true" role="dialog" - style="top: -16px; left: -22px; z-index: 2000;" + style="top: -16px; left: -18px; z-index: 2000;" tabindex="0" >

+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; top: 100%;" + > +
+

can navigate Toolbar Settings, closes when activated 1`] = class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" - style="top: -16px; left: -22px; will-change: transform, opacity; z-index: 2000;" + style="top: -16px; left: -18px; will-change: transform, opacity; z-index: 2000;" tabindex="0" >

+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; top: 100%;" + > +
+

can navigate Toolbar Settings, closes when activated 2`] = data-popover-open="true" data-popover-panel="true" role="dialog" - style="top: -16px; left: -22px; z-index: 2000;" + style="top: -16px; left: -18px; z-index: 2000;" tabindex="0" >

+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; top: 100%;" + > +
+

can navigate Toolbar Settings, closes when activated 3`] = class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" - style="top: -16px; left: -22px; z-index: 2000;" + style="top: -16px; left: -18px; z-index: 2000;" tabindex="0" >

+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; top: 100%;" + > +
+

Turn on monitoring diff --git a/x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap b/x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap index e577f5d52708a..5414d6f9ac16b 100644 --- a/x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap +++ b/x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap @@ -107,9 +107,9 @@ exports[`HeatmapStyleEditor is rendered 1`] = ` "#84a9cd", "#a8bfda", "#cad7e8", - "#f0d3b0", - "#ecb385", - "#ea8d69", + "#f5d9b1", + "#efb785", + "#eb8f69", "#e7664c", ], "type": "gradient", diff --git a/x-pack/platform/plugins/shared/security/server/__snapshots__/prompt_page.test.tsx.snap b/x-pack/platform/plugins/shared/security/server/__snapshots__/prompt_page.test.tsx.snap index df1140ea44828..447fe4b5c92a1 100644 --- a/x-pack/platform/plugins/shared/security/server/__snapshots__/prompt_page.test.tsx.snap +++ b/x-pack/platform/plugins/shared/security/server/__snapshots__/prompt_page.test.tsx.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PromptPage renders as expected with additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; +exports[`PromptPage renders as expected with additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; -exports[`PromptPage renders as expected without additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; +exports[`PromptPage renders as expected without additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; diff --git a/x-pack/platform/plugins/shared/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap b/x-pack/platform/plugins/shared/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap index 80a7e7a24e1e9..8ca838fa1ce60 100644 --- a/x-pack/platform/plugins/shared/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap +++ b/x-pack/platform/plugins/shared/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`UnauthenticatedPage renders as expected 1`] = `"ElasticMockedFonts

We hit an authentication error

Try logging in again, and if the problem persists, contact your system administrator.

"`; +exports[`UnauthenticatedPage renders as expected 1`] = `"ElasticMockedFonts

We hit an authentication error

Try logging in again, and if the problem persists, contact your system administrator.

"`; -exports[`UnauthenticatedPage renders as expected with custom title 1`] = `"My Company NameMockedFonts

We hit an authentication error

Try logging in again, and if the problem persists, contact your system administrator.

"`; +exports[`UnauthenticatedPage renders as expected with custom title 1`] = `"My Company NameMockedFonts

We hit an authentication error

Try logging in again, and if the problem persists, contact your system administrator.

"`; diff --git a/x-pack/platform/plugins/shared/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap b/x-pack/platform/plugins/shared/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap index e7a902015afa7..18a3568c092c4 100644 --- a/x-pack/platform/plugins/shared/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap +++ b/x-pack/platform/plugins/shared/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ResetSessionPage renders as expected 1`] = `"ElasticMockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; +exports[`ResetSessionPage renders as expected 1`] = `"ElasticMockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; -exports[`ResetSessionPage renders as expected with custom page title 1`] = `"My Company NameMockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; +exports[`ResetSessionPage renders as expected with custom page title 1`] = `"My Company NameMockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; diff --git a/x-pack/solutions/observability/plugins/apm/public/hooks/use_breakpoints.test.tsx b/x-pack/solutions/observability/plugins/apm/public/hooks/use_breakpoints.test.tsx index 7a9a7aa33b6b2..f8fa527b3cbb6 100644 --- a/x-pack/solutions/observability/plugins/apm/public/hooks/use_breakpoints.test.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/hooks/use_breakpoints.test.tsx @@ -7,11 +7,12 @@ import React, { FC, PropsWithChildren } from 'react'; import { renderHook } from '@testing-library/react'; -import { EuiProvider } from '@elastic/eui'; +import { EuiProvider, EuiThemeAmsterdam } from '@elastic/eui'; import { useBreakpoints } from './use_breakpoints'; const wrapper: FC> = ({ children }) => (
+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; bottom: 100%;" + > +
+
+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; bottom: 100%;" + > +
+
+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; bottom: 100%;" + > +
+
+ class="euiPopover__arrowWrapper emotion-euiPopoverArrowWrapper" + style="left: 9px; bottom: 100%;" + > +
+

{ expect(nodesWithValue).to.eql([ { name: 'host-5', value: 10, color: '#6092c0' }, { name: 'host-4', value: 30, color: '#9ab6d5' }, - { name: 'host-1', value: 50, color: '#f1d9b9' }, - { name: 'host-2', value: 70, color: '#eba47a' }, + { name: 'host-1', value: 50, color: '#f6e0b9' }, + { name: 'host-2', value: 70, color: '#eda77a' }, { name: 'host-3', value: 90, color: '#e7664c' }, ]); }); diff --git a/x-pack/test/functional/apps/lens/group4/chart_data.ts b/x-pack/test/functional/apps/lens/group4/chart_data.ts index 512f820e7ed75..78e2e357348e6 100644 --- a/x-pack/test/functional/apps/lens/group4/chart_data.ts +++ b/x-pack/test/functional/apps/lens/group4/chart_data.ts @@ -118,7 +118,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { { key: '5,722.775 - 8,529.22', name: '5,722.775 - 8,529.22', color: '#6092c0' }, { key: '8,529.22 - 11,335.665', name: '8,529.22 - 11,335.665', color: '#a8bfda' }, { key: '11,335.665 - 14,142.11', name: '11,335.665 - 14,142.11', color: '#ebeff5' }, - { key: '14,142.11 - 16,948.555', name: '14,142.11 - 16,948.555', color: '#ecb385' }, + { key: '14,142.11 - 16,948.555', name: '14,142.11 - 16,948.555', color: '#efb785' }, { key: '≥ 16,948.555', name: '≥ 16,948.555', color: '#e7664c' }, ]); }); diff --git a/x-pack/test/functional/apps/lens/group5/heatmap.ts b/x-pack/test/functional/apps/lens/group5/heatmap.ts index 7597b0448433d..5909b23fd16e7 100644 --- a/x-pack/test/functional/apps/lens/group5/heatmap.ts +++ b/x-pack/test/functional/apps/lens/group5/heatmap.ts @@ -59,7 +59,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { { key: '5,722.775 - 8,529.22', name: '5,722.775 - 8,529.22', color: '#6092c0' }, { key: '8,529.22 - 11,335.665', name: '8,529.22 - 11,335.665', color: '#a8bfda' }, { key: '11,335.665 - 14,142.11', name: '11,335.665 - 14,142.11', color: '#ebeff5' }, - { key: '14,142.11 - 16,948.555', name: '14,142.11 - 16,948.555', color: '#ecb385' }, + { key: '14,142.11 - 16,948.555', name: '14,142.11 - 16,948.555', color: '#efb785' }, { key: '≥ 16,948.555', name: '≥ 16,948.555', color: '#e7664c' }, ]); }); @@ -81,7 +81,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { { key: '7,125.997 - 8,529.22', name: '7,125.997 - 8,529.22', color: '#6092c0' }, { key: '8,529.22 - 11,335.665', name: '8,529.22 - 11,335.665', color: '#a8bfda' }, { key: '11,335.665 - 14,142.11', name: '11,335.665 - 14,142.11', color: '#ebeff5' }, - { key: '14,142.11 - 16,948.555', name: '14,142.11 - 16,948.555', color: '#ecb385' }, + { key: '14,142.11 - 16,948.555', name: '14,142.11 - 16,948.555', color: '#efb785' }, { key: '≥ 16,948.555', name: '≥ 16,948.555', color: '#e7664c' }, ]); }); @@ -95,7 +95,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { { key: '7,125.99 - 8,529.2', name: '7,125.99 - 8,529.2', color: '#6092c0' }, { key: '8,529.2 - 11,335.66', name: '8,529.2 - 11,335.66', color: '#a8bfda' }, { key: '11,335.66 - 14,142.1', name: '11,335.66 - 14,142.1', color: '#ebeff5' }, - { key: '14,142.1 - 16,948.55', name: '14,142.1 - 16,948.55', color: '#ecb385' }, + { key: '14,142.1 - 16,948.55', name: '14,142.1 - 16,948.55', color: '#efb785' }, { color: '#e7664c', key: '≥ 16,948.55', @@ -116,7 +116,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { { key: '0 - 8,529.2', name: '0 - 8,529.2', color: '#6092c0' }, { key: '8,529.2 - 11,335.66', name: '8,529.2 - 11,335.66', color: '#a8bfda' }, { key: '11,335.66 - 14,142.1', name: '11,335.66 - 14,142.1', color: '#ebeff5' }, - { key: '14,142.1 - 16,948.55', name: '14,142.1 - 16,948.55', color: '#ecb385' }, + { key: '14,142.1 - 16,948.55', name: '14,142.1 - 16,948.55', color: '#efb785' }, { key: '≥ 16,948.55', name: '≥ 16,948.55', color: '#e7664c' }, ]); }); @@ -134,7 +134,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { { key: '5,722.775 - 8,529.2', name: '5,722.775 - 8,529.2', color: '#6092c0' }, { key: '8,529.2 - 11,335.66', name: '8,529.2 - 11,335.66', color: '#a8bfda' }, { key: '11,335.66 - 14,142.1', name: '11,335.66 - 14,142.1', color: '#ebeff5' }, - { key: '14,142.1 - 16,948.55', name: '14,142.1 - 16,948.55', color: '#ecb385' }, + { key: '14,142.1 - 16,948.55', name: '14,142.1 - 16,948.55', color: '#efb785' }, { key: '≥ 16,948.55', name: '≥ 16,948.55', color: '#e7664c' }, ]); // assert the cell has the correct coloring despite the legend rounding