From 0870bfe868a9305d2400c6c1861ed8b1e0dd8ef1 Mon Sep 17 00:00:00 2001 From: Bree Hall Date: Wed, 28 Sep 2022 16:45:21 -0400 Subject: [PATCH] Updated reference to mixins Sass file. Updated snapshots for Jest Test Suite #5 to account for EuiButton Emotion conversion. Updated unit tests that target EuiButton to simulate click events. These tests have been updated to target a button element to prevent undefined click event errors --- .../public/search/errors/timeout_error.test.tsx | 2 +- .../tests/saved_object_finder_create_new.test.tsx | 2 +- .../add_data/__snapshots__/add_data.test.tsx.snap | 2 ++ .../tutorial/__snapshots__/footer.test.js.snap | 2 ++ .../__snapshots__/instruction_set.test.js.snap | 10 ++++++++++ .../saved_objects_installer.test.js.snap | 14 ++++++++------ .../workpad_header/view_menu/custom_interval.tsx | 4 ++-- x-pack/plugins/lens/public/_mixins.scss | 2 +- .../config_panel/config_panel.test.tsx | 4 ++-- .../workspace_panel/chart_switch.test.tsx | 2 +- .../coloring/palette_panel_container.scss | 2 +- .../datatable/components/toolbar.test.tsx | 3 +-- .../gauge/toolbar_component/gauge_toolbar.test.tsx | 3 +-- .../public/visualizations/metric/toolbar.test.tsx | 3 +-- .../public/components/session_view/index.test.tsx | 4 ++-- 15 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/plugins/data/public/search/errors/timeout_error.test.tsx b/src/plugins/data/public/search/errors/timeout_error.test.tsx index aa370f395df5ef..536d8931c0d76c 100644 --- a/src/plugins/data/public/search/errors/timeout_error.test.tsx +++ b/src/plugins/data/public/search/errors/timeout_error.test.tsx @@ -32,7 +32,7 @@ describe('SearchTimeoutError', () => { const component = mount(e.getErrorMessage(startMock.application)); expect(component.find('EuiButton').length).toBe(1); - component.find('EuiButton').simulate('click'); + component.find('button[data-test-subj="searchTimeoutError"]').simulate('click'); expect(startMock.application.navigateToApp).toHaveBeenCalledWith('management', { path: '/kibana/settings', }); diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/tests/saved_object_finder_create_new.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/tests/saved_object_finder_create_new.test.tsx index fce942716e001f..563d5c11f5e578 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/tests/saved_object_finder_create_new.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/tests/saved_object_finder_create_new.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { SavedObjectFinderCreateNew } from '../saved_object_finder_create_new'; import { shallow } from 'enzyme'; -import { EuiButton, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import { EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; describe('SavedObjectFinderCreateNew', () => { diff --git a/src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap b/src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap index 58f9581a1ec916..37a1cd71c04e7c 100644 --- a/src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap +++ b/src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap @@ -55,11 +55,13 @@ exports[`AddData render 1`] = ` } > launch myapp diff --git a/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap index 5235392121ab03..03609aebc36ece 100644 --- a/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap +++ b/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap @@ -191,8 +191,10 @@ exports[`statusCheckState checking status 1`] = ` size="s" /> custom btn label @@ -305,8 +307,10 @@ exports[`statusCheckState failed status check - error 1`] = ` size="s" /> custom btn label @@ -428,8 +432,10 @@ exports[`statusCheckState failed status check - no data 1`] = ` size="s" /> custom btn label @@ -551,8 +557,10 @@ exports[`statusCheckState initial state - no check has been attempted 1`] = ` size="s" /> custom btn label @@ -665,8 +673,10 @@ exports[`statusCheckState successful status check 1`] = ` size="s" /> custom btn label diff --git a/src/plugins/home/public/application/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap index 37bdf1464bb52e..6fc57bc9af1cce 100644 --- a/src/plugins/home/public/application/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap +++ b/src/plugins/home/public/application/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap @@ -25,15 +25,15 @@ Array [ class="euiFlexItem euiFlexItem--flexGrowZero" >