From b0435452086ba9c94db47490fc309246b95b6271 Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Mon, 18 Dec 2023 18:15:15 +0100 Subject: [PATCH] Upgrade EUI to v91.0.0 (with backports) (#170716) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `v90.0.0`⏩`v91.0.0-backport.0` ⚠️ While this upgrade pings many teams and has a large code diff, **the majority of the changes are snapshots or tests-related** and do not touch source code, so should theoretically only need a code review and not dedicated QA. The changes in EUI that required a large swathe of these updates are: - **EuiPopover** removed an extra unnecessary `
` wrapper on its anchors, which affected many snapshots and a few CSS overrides, which should have been updated - **EuiButtonGroup** now renders ` -
+ +
{ ), 'euiAbsoluteTab.dateFormatError': ({ dateFormat }: EuiValues) => i18n.translate('core.euiAbsoluteTab.dateFormatError', { - defaultMessage: 'Expected format: {dateFormat}', + defaultMessage: 'Allowed formats: {dateFormat}, ISO 8601, RFC 2822, or Unix timestamp.', values: { dateFormat }, }), 'euiRelativeTab.fullDescription': ({ unit }: EuiValues) => @@ -1454,6 +1454,9 @@ export const getEuiContextMapping = (): EuiTokensObject => { 'euiRelativeTab.dateInputError': i18n.translate('core.euiRelativeTab.dateInputError', { defaultMessage: 'Must be a valid range', }), + 'euiAbsoluteTab.dateFormatHint': i18n.translate('core.euiAbsoluteTab.dateFormatHint', { + defaultMessage: 'Press the Enter key to parse as a date.', + }), 'euiResizableButton.horizontalResizerAriaLabel': i18n.translate( 'core.euiResizableButton.horizontalResizerAriaLabel', { diff --git a/packages/home/sample_data_card/src/__snapshots__/sample_data_card.test.tsx.snap b/packages/home/sample_data_card/src/__snapshots__/sample_data_card.test.tsx.snap index 9f397dc7ccbd79..269499f65547af 100644 --- a/packages/home/sample_data_card/src/__snapshots__/sample_data_card.test.tsx.snap +++ b/packages/home/sample_data_card/src/__snapshots__/sample_data_card.test.tsx.snap @@ -83,33 +83,29 @@ exports[`SampleDataCard installed renders with app links 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ + +
diff --git a/packages/home/sample_data_card/src/footer/__snapshots__/view_button.test.tsx.snap b/packages/home/sample_data_card/src/footer/__snapshots__/view_button.test.tsx.snap index ca5d1ccce07391..472852006ca26f 100644 --- a/packages/home/sample_data_card/src/footer/__snapshots__/view_button.test.tsx.snap +++ b/packages/home/sample_data_card/src/footer/__snapshots__/view_button.test.tsx.snap @@ -2,65 +2,57 @@ exports[`should render popover when appLinks is not empty 1`] = `
-
- -
+ + +
`; exports[`should render popover with ordered appLinks 1`] = `
-
- -
+ + +
`; diff --git a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap index 8cc75ec2beab86..1a4c9076a20d6f 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap @@ -10,90 +10,7 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
-
-
-
- - - machine.os.raw - - - -
-
- - -
-
-
-
-
- - - , - "container":
-
-
-
- - - machine.os.raw - -
+ , + "container":
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
, "debug": [Function], "findAllByAltText": [Function], @@ -227,46 +199,32 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
- - - machine.os.raw - - - -
+
@@ -280,46 +238,32 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
- - - machine.os.raw - - - -
+
@@ -390,79 +334,7 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
-
-
-
- - - machine.os.raw - - - -
-
- -
-
-
-
-
-
-
- , - "container":
-
-
-
- - - machine.os.raw - -
+ , + "container":
+
+
+
+
+
+ +
+
+ +
+
+
+
+
, "debug": [Function], "findAllByAltText": [Function], @@ -585,72 +501,7 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
-
-
-
- - - machine.os.raw - - - -
-
- -
-
-
-
-
-
-
- , - "container":
-
-
-
- - - machine.os.raw - -
+ , + "container":
+
+
+
+
+
+ +
+
+ +
+
+
+
+
, "debug": [Function], "findAllByAltText": [Function], diff --git a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/index.test.tsx index 48f7a109646f06..9ac7d9e58ee8bd 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/index.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { fireEvent, render, waitFor } from '@testing-library/react'; +import { fireEvent, render, waitFor, within } from '@testing-library/react'; import '@testing-library/jest-dom'; import { FieldComponent } from '..'; @@ -31,7 +31,9 @@ describe('FieldComponent', () => { /> ); expect(wrapper).toMatchSnapshot(); - expect(wrapper.getByTestId('fieldAutocompleteComboBox')).toHaveTextContent('machine.os.raw'); + const comboBox = wrapper.getByTestId('fieldAutocompleteComboBox'); + const input = within(comboBox).getByRole('combobox'); + expect(input).toHaveAttribute('value', 'machine.os.raw'); }); it('should render the component disabled if isDisabled is true', () => { const wrapper = render( diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx index acd1a315d2c482..733e111fb4dd5d 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx @@ -182,9 +182,9 @@ describe('AutocompleteFieldListsComponent', () => { expect( wrapper - .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] EuiComboBoxPill`) + .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input`) .at(0) - .text() + .props().value ).toEqual('some name'); }); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx index 24bb72c3058ac9..5d4f8cd89f1ccc 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx @@ -166,7 +166,7 @@ describe('AutocompleteFieldMatchComponent', () => { ); expect( - wrapper.find('[data-test-subj="valuesAutocompleteMatch"] EuiComboBoxPill').at(0).text() + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().value ).toEqual('127.0.0.1'); }); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx index 9eab42f5cec731..ec442385a1fd38 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx @@ -168,7 +168,7 @@ describe('AutocompleteFieldWildcardComponent', () => { ); expect( - wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] EuiComboBoxPill').at(0).text() + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').at(0).props().value ).toEqual('/opt/*/app.dmg'); }); diff --git a/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx index 954b14a8ea244d..21ed99dce4b721 100644 --- a/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx @@ -152,7 +152,7 @@ describe('operator', () => { ); expect( - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"] EuiComboBoxPill`).at(0).text() + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value ).toEqual('is'); }); diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap index ff7dddd2da9505..eecc554cd4e005 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap @@ -101,7 +101,7 @@ Object { class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="exceptionItemCardComments" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -239,7 +239,7 @@ Object { class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="exceptionItemCardComments" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -433,7 +433,7 @@ Object { aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="exceptionItemCardComments" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -570,7 +570,7 @@ Object { aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="exceptionItemCardComments" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > diff --git a/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap index dae6c052360015..5f87fe13836342 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap @@ -9,40 +9,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -124,26 +116,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -157,7 +145,7 @@ Object { aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -226,26 +214,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
, @@ -312,40 +296,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -427,45 +403,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -552,45 +520,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -677,46 +637,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -804,45 +756,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap index a458aa90dbedcb..c83f098c6d0906 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap @@ -197,26 +197,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -584,26 +580,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -867,26 +859,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1093,26 +1081,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1348,27 +1332,23 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1547,27 +1527,23 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1784,26 +1760,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1826,7 +1798,7 @@ Object { aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -2053,26 +2025,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap index 90c90a4f3eea54..a58f4a042bca32 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap @@ -16,33 +16,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -53,26 +49,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -91,33 +83,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -128,26 +116,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -252,26 +236,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -319,26 +299,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -443,26 +419,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -478,7 +450,7 @@ Object { aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -598,26 +570,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -693,33 +661,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -730,26 +694,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -765,7 +725,7 @@ Object { aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -858,33 +818,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -895,26 +851,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -990,33 +942,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -1046,26 +994,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1084,33 +1028,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -1140,26 +1080,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
diff --git a/packages/kbn-unified-data-table/src/components/data_table.test.tsx b/packages/kbn-unified-data-table/src/components/data_table.test.tsx index f898c4707717e5..e69d1a88200ba2 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.test.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table.test.tsx @@ -308,7 +308,7 @@ describe('UnifiedDataTable', () => { columns: ['message'], }); - expect(component.find(EuiDataGrid).prop('sorting')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).last().prop('sorting')).toMatchInlineSnapshot(` Object { "columns": Array [ Object { @@ -332,7 +332,7 @@ describe('UnifiedDataTable', () => { columns: ['bytes', 'message'], }); - expect(component.find(EuiDataGrid).prop('sorting')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).last().prop('sorting')).toMatchInlineSnapshot(` Object { "columns": Array [ Object { @@ -359,7 +359,7 @@ describe('UnifiedDataTable', () => { onUpdateRowHeight: jest.fn(), }); - expect(component.find(EuiDataGrid).prop('toolbarVisibility')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).first().prop('toolbarVisibility')).toMatchInlineSnapshot(` Object { "additionalControls": null, "showColumnSelector": false, @@ -385,7 +385,7 @@ describe('UnifiedDataTable', () => { onUpdateRowHeight: jest.fn(), }); - expect(component.find(EuiDataGrid).prop('toolbarVisibility')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).first().prop('toolbarVisibility')).toMatchInlineSnapshot(` Object { "additionalControls": null, "showColumnSelector": false, @@ -406,7 +406,7 @@ describe('UnifiedDataTable', () => { onUpdateSampleSize: undefined, }); - expect(component.find(EuiDataGrid).prop('toolbarVisibility')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).first().prop('toolbarVisibility')).toMatchInlineSnapshot(` Object { "additionalControls": null, "showColumnSelector": false, diff --git a/packages/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap b/packages/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap index 441d85d917ef3a..141a8c7b437b81 100644 --- a/packages/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap +++ b/packages/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap @@ -3,34 +3,30 @@ exports[` should show all menu items 1`] = `
-
- -
+ + +
`; diff --git a/packages/kbn-unsaved-changes-badge/src/utils/__snapshots__/get_top_nav_unsaved_changes_badge.test.tsx.snap b/packages/kbn-unsaved-changes-badge/src/utils/__snapshots__/get_top_nav_unsaved_changes_badge.test.tsx.snap index eafe487e0265c1..a2cca8a1cc1e35 100644 --- a/packages/kbn-unsaved-changes-badge/src/utils/__snapshots__/get_top_nav_unsaved_changes_badge.test.tsx.snap +++ b/packages/kbn-unsaved-changes-badge/src/utils/__snapshots__/get_top_nav_unsaved_changes_badge.test.tsx.snap @@ -3,34 +3,30 @@ exports[`getTopNavUnsavedChangesBadge() should work correctly 1`] = `
-
- -
+ + +
`; diff --git a/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx b/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx index e998e48eefe99c..ac24f7bb818605 100644 --- a/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx +++ b/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx @@ -101,7 +101,7 @@ export function FilterQueryInput({ is rendered 1`] = `
-
- -
+ + +
`; diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 08d4267e52b639..b0919d0ab61415 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -85,7 +85,7 @@ export const LICENSE_OVERRIDES = { 'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint '@elastic/ems-client@8.5.1': ['Elastic License 2.0'], - '@elastic/eui@90.0.1-backport.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@91.0.0-backport.0': ['SSPL-1.0 OR Elastic License 2.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry 'buffers@0.1.1': ['MIT'], // license in importing module https://www.npmjs.com/package/binary }; diff --git a/src/plugins/controls/public/control_group/component/control_error_component.tsx b/src/plugins/controls/public/control_group/component/control_error_component.tsx index 409455f0e304e9..6cdd1b5fc1fffe 100644 --- a/src/plugins/controls/public/control_group/component/control_error_component.tsx +++ b/src/plugins/controls/public/control_group/component/control_error_component.tsx @@ -43,7 +43,6 @@ export const ControlError = ({ error }: ControlErrorProps) => { button={popoverButton} isOpen={isPopoverOpen} className="errorEmbeddableCompact__popover" - anchorClassName="errorEmbeddableCompact__popoverAnchor" closePopover={() => setPopoverOpen(false)} > { const popover = await mountComponent(); const includeButton = findTestSubject(popover, 'optionsList__includeResults'); const excludeButton = findTestSubject(popover, 'optionsList__excludeResults'); - expect(includeButton.prop('checked')).toBe(true); - expect(excludeButton.prop('checked')).toBeFalsy(); + expect(includeButton.prop('aria-pressed')).toBe(true); + expect(excludeButton.prop('aria-pressed')).toBe(false); }); test('if exclude = true, select appropriate button in button group', async () => { @@ -163,8 +163,8 @@ describe('Options list popover', () => { }); const includeButton = findTestSubject(popover, 'optionsList__includeResults'); const excludeButton = findTestSubject(popover, 'optionsList__excludeResults'); - expect(includeButton.prop('checked')).toBeFalsy(); - expect(excludeButton.prop('checked')).toBe(true); + expect(includeButton.prop('aria-pressed')).toBe(false); + expect(excludeButton.prop('aria-pressed')).toBe(true); }); test('clicking another option unselects "Exists"', async () => { @@ -176,8 +176,8 @@ describe('Options list popover', () => { const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); availableOptionsDiv.children().forEach((child, i) => { - if (child.text() === 'woof') expect(child.prop('checked')).toBe('on'); - else expect(child.prop('checked')).toBeFalsy(); + if (child.text() === 'woof') expect(child.prop('aria-pressed')).toBe(true); + else expect(child.prop('aria-pressed')).toBeFalsy(); }); }); @@ -189,15 +189,15 @@ describe('Options list popover', () => { const existsOption = findTestSubject(popover, 'optionsList-control-selection-exists'); let availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); availableOptionsDiv.children().forEach((child, i) => { - if (selections.includes(child.text())) expect(child.prop('checked')).toBe('on'); - else expect(child.prop('checked')).toBeFalsy(); + if (selections.includes(child.text())) expect(child.prop('aria-pressed')).toBe(true); + else expect(child.prop('aria-pressed')).toBeFalsy(); }); existsOption.simulate('click'); availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); availableOptionsDiv.children().forEach((child, i) => { - if (child.text() === 'Exists (*)') expect(child.prop('checked')).toBe('on'); - else expect(child.prop('checked')).toBeFalsy(); + if (child.text() === 'Exists (*)') expect(child.prop('aria-pressed')).toBe(true); + else expect(child.prop('aria-pressed')).toBeFalsy(); }); }); diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_sorting_button.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_sorting_button.tsx index d1cad0bb97c815..d246e631fba84c 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover_sorting_button.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover_sorting_button.tsx @@ -119,7 +119,6 @@ export const OptionsListPopoverSortingButton = ({ aria-labelledby="optionsList_sortingOptions" closePopover={() => setIsSortingPopoverOpen(false)} panelClassName={'optionsList--sortPopover'} - anchorClassName={'optionsList__sortButtonPopoverAnchor'} > diff --git a/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap b/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap index 06a402fd475676..8bd049df006fcd 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap +++ b/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap @@ -176,27 +176,23 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ color="inherit" + data-euiicon-type="arrowDown" + /> + +
, @@ -224,30 +220,26 @@ Array [ class="euiTableSortMobile" >
-
- -
+ + +
@@ -339,31 +331,27 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ + +
-
- -
+ + +
@@ -515,27 +499,23 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ color="inherit" + data-euiicon-type="arrowDown" + /> + +
, @@ -563,30 +543,26 @@ Array [ class="euiTableSortMobile" >
-
- -
+ + +
@@ -679,31 +655,27 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ + +
{ 'Matching sources' ); - findTestSubject(component, 'allIndices').simulate('change', { - target: { - value: true, - }, - }); + findTestSubject(component, 'allIndices').simulate('click'); await component.update(); @@ -109,11 +105,7 @@ describe('DataViewEditor PreviewPanel', () => { expect(component.find('.euiButtonGroupButton-isSelected').first().text()).toBe('All sources'); - findTestSubject(component, 'onlyMatchingIndices').simulate('change', { - target: { - value: true, - }, - }); + findTestSubject(component, 'onlyMatchingIndices').simulate('click'); await component.update(); diff --git a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.scss b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.scss index cc8d7f96982219..739d6930001e9c 100644 --- a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.scss +++ b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.scss @@ -1,9 +1,6 @@ .errorEmbeddableCompact__popover { height: 100%; -} - -.errorEmbeddableCompact__popoverAnchor { max-width: 100%; } diff --git a/src/plugins/home/public/application/components/tutorial/tutorial.test.js b/src/plugins/home/public/application/components/tutorial/tutorial.test.js index 3d0fde31aadbc7..be5dbfe3105509 100644 --- a/src/plugins/home/public/application/components/tutorial/tutorial.test.js +++ b/src/plugins/home/public/application/components/tutorial/tutorial.test.js @@ -130,7 +130,7 @@ describe('isCloudEnabled is false', () => { ); await loadTutorialPromise; component.update(); - component.find('#onPremElasticCloud').first().find('input').simulate('change'); + component.find('button[data-test-subj="onCloudTutorial"]').simulate('click'); component.update(); expect(component.state('visibleInstructions')).toBe('onPremElasticCloud'); }); diff --git a/src/plugins/inspector/public/ui/__snapshots__/inspector_panel.test.tsx.snap b/src/plugins/inspector/public/ui/__snapshots__/inspector_panel.test.tsx.snap index 3ebb9ee096fc52..11e7964056745f 100644 --- a/src/plugins/inspector/public/ui/__snapshots__/inspector_panel.test.tsx.snap +++ b/src/plugins/inspector/public/ui/__snapshots__/inspector_panel.test.tsx.snap @@ -21,32 +21,28 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ + +
diff --git a/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.scss b/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.scss index 787376fac04900..1c16adbfc8c133 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.scss +++ b/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.scss @@ -73,11 +73,6 @@ padding: $euiSizeM; } -.globalFilterItem__popover, -.globalFilterItem__popoverAnchor { - display: block; -} - .globalFilterItem__readonlyPanel { min-width: auto; padding: $euiSizeM; diff --git a/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.tsx b/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.tsx index d29529f59a3c96..596a32ea0a2f58 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.tsx +++ b/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.tsx @@ -367,8 +367,7 @@ function FilterItemComponent(props: FilterItemProps) { const popoverProps: FilterPopoverProps = { id: `popoverFor_filter${id}`, - className: `globalFilterItem__popover`, - anchorClassName: `globalFilterItem__popoverAnchor`, + display: 'block', isOpen: isPopoverOpen, closePopover, button: , diff --git a/src/plugins/unified_search/public/query_string_input/no_data_popover.tsx b/src/plugins/unified_search/public/query_string_input/no_data_popover.tsx index 7e9760486bb930..8fde7a52e6bd5a 100644 --- a/src/plugins/unified_search/public/query_string_input/no_data_popover.tsx +++ b/src/plugins/unified_search/public/query_string_input/no_data_popover.tsx @@ -67,7 +67,6 @@ export function NoDataPopover({ } minWidth={300} anchorPosition="downCenter" - anchorClassName="eui-displayBlock" step={1} stepsTotal={1} isStepOpen={noDataPopoverVisible} diff --git a/src/plugins/vis_types/vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap b/src/plugins/vis_types/vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap index cc95e272d54f73..d23c14423efbb9 100644 --- a/src/plugins/vis_types/vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap +++ b/src/plugins/vis_types/vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap @@ -2,4 +2,4 @@ exports[`VisLegend Component Legend closed should match the snapshot 1`] = `"
"`; -exports[`VisLegend Component Legend open should match the snapshot 1`] = `"
"`; +exports[`VisLegend Component Legend open should match the snapshot 1`] = `"
"`; diff --git a/test/examples/content_management/todo_app.ts b/test/examples/content_management/todo_app.ts index 5c5739c962e2d7..7812f1fcf66467 100644 --- a/test/examples/content_management/todo_app.ts +++ b/test/examples/content_management/todo_app.ts @@ -28,17 +28,17 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide expect(todos.length).to.be(2); // check that filters work - await (await find.byCssSelector('label[title="Completed"]')).click(); + await (await find.byButtonText('Completed')).click(); await testSubjects.missingOrFail(`todoPending`); todos = await testSubjects.findAll(`~todoItem`); expect(todos.length).to.be(1); - await (await find.byCssSelector('label[title="Todo"]')).click(); + await (await find.byButtonText('Todo')).click(); await testSubjects.missingOrFail(`todoPending`); todos = await testSubjects.findAll(`~todoItem`); expect(todos.length).to.be(1); - await (await find.byCssSelector('label[title="All"]')).click(); + await (await find.byButtonText('All')).click(); await testSubjects.missingOrFail(`todoPending`); todos = await testSubjects.findAll(`~todoItem`); expect(todos.length).to.be(2); @@ -56,9 +56,10 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide let newTodoCheckbox = await newTodo.findByTestSubject('~todoCheckbox'); expect(await newTodoCheckbox.isSelected()).to.be(false); await (await newTodo.findByTagName('label')).click(); + await newTodo.click(); await testSubjects.missingOrFail(`todoPending`); - await (await find.byCssSelector('label[title="Completed"]')).click(); + await (await find.byButtonText('Completed')).click(); await testSubjects.missingOrFail(`todoPending`); todos = await testSubjects.findAll(`~todoItem`); expect(todos.length).to.be(2); diff --git a/test/functional/page_objects/time_picker.ts b/test/functional/page_objects/time_picker.ts index 1566c15533810b..aa8832f28848ab 100644 --- a/test/functional/page_objects/time_picker.ts +++ b/test/functional/page_objects/time_picker.ts @@ -107,6 +107,8 @@ export class TimePickerPageObject extends FtrService { } else { await this.testSubjects.setValue(dataTestSubj, value); } + + await this.testSubjects.pressEnter(dataTestSubj); } private async showStartEndTimes() { diff --git a/test/functional/services/combo_box.ts b/test/functional/services/combo_box.ts index 78c36a87636f70..4b23dd3bd8b981 100644 --- a/test/functional/services/combo_box.ts +++ b/test/functional/services/combo_box.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import expect from '@kbn/expect'; import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from './lib/web_element_wrapper'; @@ -84,6 +85,7 @@ export class ComboBoxService extends FtrService { const isOptionSelected = await this.isOptionSelected(comboBoxElement, trimmedValue); if (isOptionSelected) { + this.log.debug(`value is already selected. returning`); return; } @@ -116,7 +118,7 @@ export class ComboBoxService extends FtrService { const [alternate] = alternateTitle ? await this.find.allByCssSelector( - `.euiFilterSelectItem[title="${alternateTitle}"]`, + `.euiFilterSelectItem[title="${alternateTitle}" i]`, this.WAIT_FOR_EXISTS_TIME ) : []; @@ -177,15 +179,28 @@ export class ComboBoxService extends FtrService { * @param comboBoxElement element that wraps up EuiComboBox * @param filterValue text */ - private async setFilterValue( + public async setFilterValue( comboBoxElement: WebElementWrapper, filterValue: string ): Promise { const input = await comboBoxElement.findByTagName('input'); - await input.clearValue(); - await this.waitForOptionsListLoading(comboBoxElement); - await input.type(filterValue); - await this.waitForOptionsListLoading(comboBoxElement); + + await this.retry.try(async () => { + // Wait for the input to not be disabled before typing into it (otherwise + // typing will sometimes trigger the global search bar instead) + expect(await input.isEnabled()).to.equal(true); + + // Some Kibana comboboxes force state to not be clearable, so we can't use `input.clearValue()`. + // This is not-great production UX and shouldn't be happening, but for now we're going to + // work around it in FTR tests by selecting all existing text and typing to replace + if (!!(await input.getAttribute('value'))) { + await input.selectValueWithKeyboard(); + } + await input.type(filterValue); + await this.waitForOptionsListLoading(comboBoxElement); + + expect(await input.getAttribute('value')).to.equal(filterValue); + }); } /** @@ -241,9 +256,29 @@ export class ComboBoxService extends FtrService { this.log.debug(`comboBox.getComboBoxSelectedOptions, comboBoxSelector: ${comboBoxSelector}`); const comboBox = await this.testSubjects.find(comboBoxSelector); const $ = await comboBox.parseDomContent(); - return $('.euiComboBoxPill') + + if (await this.isSingleSelectionPlainText(comboBox)) { + const input = $('[data-test-subj="comboBoxSearchInput"]'); + this.log.debug('Single selection value: ', input.val()); + + const isValid = input.attr('aria-invalid') !== 'true'; + + if (isValid) { + const value = input.val(); + return value ? [value] : []; // Don't return empty strings + } else { + this.log.debug( + 'Single selection value is not valid and thus not selected - returning empty array' + ); + return []; + } + } + + const options = $('.euiComboBoxPill') .toArray() .map((option) => $(option).text()); + + return options; } /** @@ -315,8 +350,8 @@ export class ComboBoxService extends FtrService { if (!isOptionsListOpen) { await this.retry.try(async () => { - const toggleBtn = await comboBoxElement.findByTestSubject('comboBoxInput'); - await toggleBtn.click(); + const inputWrapper = await this.getComboBoxInputWrapper(comboBoxElement); + await inputWrapper.click(); }); } } @@ -333,9 +368,21 @@ export class ComboBoxService extends FtrService { ): Promise { this.log.debug(`comboBox.isOptionSelected, value: ${value}`); const $ = await comboBoxElement.parseDomContent(); + + if (await this.isSingleSelectionPlainText(comboBoxElement)) { + const input = $('input[role="combobox"]'); + + const hasValidValue = + input.attr('aria-invalid') !== 'true' && + value.toLowerCase().trim() === input.val().toLowerCase().trim(); // Normalizing text here for Firefox driver shenanigans + + return !!hasValidValue; + } + const selectedOptions = $('.euiComboBoxPill') .toArray() .map((option) => $(option).text()); + return ( selectedOptions.length === 1 && selectedOptions[0].toLowerCase().trim() === value.toLowerCase().trim() @@ -369,4 +416,26 @@ export class ComboBoxService extends FtrService { this.log.debug(`isDisabled:${isDisabled}`); return isDisabled?.toLowerCase() === 'true'; } + + /** + * Single selection plain text comboboxes do not render pill text, but instead render + * selected as well as search values in the child + */ + private async isSingleSelectionPlainText(comboBoxElement: WebElementWrapper): Promise { + const inputWrapper = await this.getComboBoxInputWrapper(comboBoxElement); + return await inputWrapper.elementHasClass('euiComboBox__inputWrap--plainText'); + } + + /** + * Kibana devs sometimes pass in the `comboBoxInput` element and not the parent wrapper 🤷 + * This util accounts for that and returns the `data-test-subj="comboBoxInput"` element no matter what + */ + private async getComboBoxInputWrapper( + comboBoxElement: WebElementWrapper + ): Promise { + const isInputWrapper = await comboBoxElement.elementHasClass('euiComboBox__inputWrap'); + return isInputWrapper + ? comboBoxElement + : await comboBoxElement.findByTestSubject('comboBoxInput'); + } } diff --git a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts index 70df204b1de03c..6a914c7273ba34 100644 --- a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts +++ b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts @@ -261,28 +261,28 @@ export class WebElementWrapper { * @default { charByChar: false } */ async clearValueWithKeyboard(options: TypeOptions = { charByChar: false }) { + const value = await this.getAttribute('value'); + if (!value.length) { + return; + } + if (options.charByChar === true) { - const value = await this.getAttribute('value'); for (let i = 0; i <= value.length; i++) { await this.pressKeys(this.Keys.BACK_SPACE); await setTimeoutAsync(100); } } else { - if (this.isChromium) { - // https://bugs.chromium.org/p/chromedriver/issues/detail?id=30 - await this.retryCall(async function clearValueWithKeyboard(wrapper) { - await wrapper.driver.executeScript(`arguments[0].select();`, wrapper._webElement); - }); - await this.pressKeys(this.Keys.BACK_SPACE); - } else { - const selectionKey = this.Keys[process.platform === 'darwin' ? 'COMMAND' : 'CONTROL']; - await this.pressKeys([selectionKey, 'a']); - await this.pressKeys(this.Keys.NULL); // Release modifier keys - await this.pressKeys(this.Keys.BACK_SPACE); // Delete all content - } + await this.selectValueWithKeyboard(); + await this.pressKeys(this.Keys.BACK_SPACE); } } + async selectValueWithKeyboard() { + const selectionKey = this.Keys[process.platform === 'darwin' ? 'COMMAND' : 'CONTROL']; + await this.pressKeys([selectionKey, 'a']); + await this.pressKeys(this.Keys.NULL); // Release modifier keys + } + /** * Types a key sequence on the DOM element represented by this instance. Modifier keys * (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is processed in the key sequence, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.test.tsx index 8cd7c1dd0bd64f..4ab45c10b021a2 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.test.tsx @@ -58,7 +58,7 @@ describe('Conversation selector', () => { ); expect(getByTestId('conversation-selector')).toBeInTheDocument(); - expect(getByTestId('euiComboBoxPill')).toHaveTextContent(welcomeConvo.id); + expect(getByTestId('comboBoxSearchInput')).toHaveValue(welcomeConvo.id); }); it('On change, selects new item', () => { const { getByTestId } = render( @@ -78,7 +78,7 @@ describe('Conversation selector', () => { expect(onConversationSelected).toHaveBeenCalledWith(alertConvo.id); }); it('On clear input, clears selected options', () => { - const { getByText, queryByText, getByTestId, queryByTestId } = render( + const { getByPlaceholderText, queryByPlaceholderText, getByTestId, queryByTestId } = render( ({ @@ -90,10 +90,10 @@ describe('Conversation selector', () => { ); - expect(getByTestId('euiComboBoxPill')).toBeInTheDocument(); - expect(queryByText(CONVERSATION_SELECTOR_PLACE_HOLDER)).not.toBeInTheDocument(); + expect(getByTestId('comboBoxSearchInput')).toBeInTheDocument(); + expect(queryByPlaceholderText(CONVERSATION_SELECTOR_PLACE_HOLDER)).not.toBeInTheDocument(); fireEvent.click(getByTestId('comboBoxClearButton')); - expect(getByText(CONVERSATION_SELECTOR_PLACE_HOLDER)).toBeInTheDocument(); + expect(getByPlaceholderText(CONVERSATION_SELECTOR_PLACE_HOLDER)).toBeInTheDocument(); expect(queryByTestId('euiComboBoxPill')).not.toBeInTheDocument(); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.test.tsx index afe6ede5929105..150784d9db4cf9 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.test.tsx @@ -30,7 +30,7 @@ describe('ConversationSelectorSettings', () => { }); it('Selects an existing conversation', () => { const { getByTestId } = render(); - expect(getByTestId('comboBoxInput')).toHaveTextContent(welcomeConvo.id); + expect(getByTestId('comboBoxSearchInput')).toHaveValue(welcomeConvo.id); fireEvent.click(getByTestId('comboBoxToggleListButton')); fireEvent.click(getByTestId(alertConvo.id)); expect(onConversationSelectionChange).toHaveBeenCalledWith(alertConvo); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.test.tsx index ea16553e71c6e7..d8d14a8ffebe03 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.test.tsx @@ -25,7 +25,7 @@ describe('SystemPromptSelector', () => { }); it('Selects an existing quick prompt', () => { const { getByTestId } = render(); - expect(getByTestId('euiComboBoxPill')).toHaveTextContent(mockSystemPrompts[0].name); + expect(getByTestId('comboBoxSearchInput')).toHaveValue(mockSystemPrompts[0].name); fireEvent.click(getByTestId('comboBoxToggleListButton')); fireEvent.click(getByTestId(`systemPromptSelector-${mockSystemPrompts[1].id}`)); expect(onSystemPromptSelectionChange).toHaveBeenCalledWith(mockSystemPrompts[1]); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.test.tsx index 459dfd3426584c..9138c02381eb44 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.test.tsx @@ -15,7 +15,7 @@ describe('ModelSelector', () => { const { getByTestId } = render( ); - expect(getByTestId('euiComboBoxPill')).toHaveTextContent(MODEL_GPT_3_5_TURBO); + expect(getByTestId('comboBoxSearchInput')).toHaveValue(MODEL_GPT_3_5_TURBO); }); it('should call onModelSelectionChange when custom option', () => { const onModelSelectionChange = jest.fn(); diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx index 3fea6d6611f083..a354e47975bafe 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx @@ -131,7 +131,9 @@ describe('CreateMaintenanceWindowForm', () => { 'Press the down key to open a popover containing a calendar.' ); const recurringInput = within(result.getByTestId('recurring-field')).getByTestId('input'); - const timezoneInput = within(result.getByTestId('timezone-field')).getByTestId('input'); + const timezoneInput = within(result.getByTestId('timezone-field')).getByTestId( + 'comboBoxSearchInput' + ); await waitFor(() => { expect( @@ -156,7 +158,7 @@ describe('CreateMaintenanceWindowForm', () => { expect(dateInputs[0]).toHaveValue('03/23/2023 09:00 PM'); expect(dateInputs[1]).toHaveValue('03/25/2023 09:00 PM'); expect(recurringInput).toBeChecked(); - expect(timezoneInput).toHaveTextContent('America/Los_Angeles'); + expect(timezoneInput).toHaveValue('America/Los_Angeles'); }); it('should initialize MWs without category ids properly', async () => { diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx index 6422d285db7ef7..76390aea7ef186 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx @@ -94,7 +94,7 @@ describe('RecurringSchedule', () => { const endsInput = within(result.getByTestId('ends-field')).getByTestId('never'); expect(frequencyInput).toHaveValue('3'); - expect(endsInput).toBeChecked(); + expect(endsInput).toHaveAttribute('aria-pressed', 'true'); }); it('should prefill the form when provided with initialValue', () => { @@ -119,7 +119,7 @@ describe('RecurringSchedule', () => { 'Press the down key to open a popover containing a calendar.' ); expect(frequencyInput).toHaveValue('1'); - expect(endsInput).toBeChecked(); + expect(endsInput).toHaveAttribute('aria-pressed', 'true'); expect(untilInput).toHaveValue('03/24/2023'); }); }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_groups/service_groups.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_groups/service_groups.cy.ts index bc7e7d331ccebf..731149159b6813 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_groups/service_groups.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_groups/service_groups.cy.ts @@ -82,7 +82,7 @@ describe('Service groups', () => { it('creates a service group', () => { cy.getByTestSubj('apmCreateServiceGroupButton').click(); - cy.getByTestSubj('apmGroupNameInput').type('go services'); + cy.getByTestSubj('apmGroupNameInput').type('go services{enter}'); cy.contains('Select services').click(); cy.getByTestSubj('headerFilterKuerybar').type('agent.name:"go"{enter}'); cy.contains('synth-go-1'); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/alerts_table.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/alerts_table.cy.ts index 0bce81a620a510..19c07645fb37f2 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/alerts_table.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/alerts_table.cy.ts @@ -38,7 +38,9 @@ describe('Errors table', () => { it('Alerts table with the search bar is populated', () => { cy.visitKibana(serviceOverviewHref); cy.contains('opbeans-java'); - cy.contains('All'); + cy.get( + '[data-test-subj="environmentFilter"] [data-test-subj="comboBoxSearchInput"]' + ).should('have.value', 'All'); cy.contains('Active'); cy.contains('Recovered'); cy.getByTestSubj('globalQueryBar').should('exist'); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/service_overview.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/service_overview.cy.ts index 35184a59880d74..7508612d0acc5f 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/service_overview.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/service_overview.cy.ts @@ -226,9 +226,9 @@ describe('Service Overview', () => { 'suggestionsRequest' ); - cy.getByTestSubj('environmentFilter').find('input').type('production', { - force: true, - }); + cy.getByTestSubj('environmentFilter') + .find('input') + .type('{selectall}production', { force: true }); cy.expectAPIsToHaveBeenCalledWith({ apisIntercepted: ['@suggestionsRequest'], diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/settings/agent_configurations.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/settings/agent_configurations.cy.ts index e0ca47df79996f..1d9d34d7b9a2d4 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/settings/agent_configurations.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/settings/agent_configurations.cy.ts @@ -107,7 +107,10 @@ describe('Agent configuration', () => { cy.contains('Create configuration'); cy.contains('Edit').click(); cy.wait('@serviceEnvironmentApi'); - cy.contains('production'); + cy.getByTestSubj('serviceEnviromentComboBox') + .find('input') + .invoke('val') + .should('contain', 'production'); }); it('displays All label when selecting all option', () => { cy.intercept( @@ -129,6 +132,9 @@ describe('Agent configuration', () => { cy.contains('Environment All'); cy.contains('Edit').click(); cy.wait('@serviceEnvironmentApi'); - cy.contains('All'); + cy.getByTestSubj('serviceEnviromentComboBox') + .find('input') + .invoke('val') + .should('contain', 'All'); }); }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts index bfa0aaa79d987a..11025b29dd0e7d 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts @@ -130,7 +130,7 @@ describe('Storage Explorer', () => { it('with the correct environment when changing the environment', () => { cy.wait(mainAliasNames); - cy.getByTestSubj('environmentFilter').type('production'); + cy.getByTestSubj('environmentFilter').type('{selectall}production'); cy.contains('button', 'production').click({ force: true }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts index da8b1d418f3a62..f4341fe938092c 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts @@ -94,14 +94,16 @@ Cypress.Commands.add( .nextAll() .find('[data-test-subj="superDatePickerAbsoluteDateInput"]') .clear({ force: true }) - .type(moment(start).format(format), { force: true }); + .type(moment(start).format(format), { force: true }) + .type('{enter}'); cy.getByTestSubj('superDatePickerendDatePopoverButton').click(); cy.contains('End date') .nextAll() .find('[data-test-subj="superDatePickerAbsoluteDateInput"]') .clear({ force: true }) - .type(moment(end).format(format), { force: true }); + .type(moment(end).format(format), { force: true }) + .type('{enter}'); } ); diff --git a/x-pack/plugins/apm/public/components/shared/transaction_action_menu/__snapshots__/transaction_action_menu.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/transaction_action_menu/__snapshots__/transaction_action_menu.test.tsx.snap index 17f22a43a1c43c..02ed85e387ecb5 100644 --- a/x-pack/plugins/apm/public/components/shared/transaction_action_menu/__snapshots__/transaction_action_menu.test.tsx.snap +++ b/x-pack/plugins/apm/public/components/shared/transaction_action_menu/__snapshots__/transaction_action_menu.test.tsx.snap @@ -3,32 +3,28 @@ exports[`TransactionActionMenu component matches the snapshot 1`] = `
-
- -
+ + +
`; diff --git a/x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx b/x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx index 20e3d2ad0c948c..764f2a11c02cce 100644 --- a/x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx @@ -419,9 +419,9 @@ describe('TransactionActionMenu component', () => { component .getByTestId(`${key}.value`) .querySelector( - '[data-test-subj="comboBoxInput"] span' - ) as HTMLSpanElement - ).textContent, + '[data-test-subj="comboBoxSearchInput"]' + ) as HTMLInputElement + ).value, }; }; expect(getFilterKeyValue('service.name')).toEqual({ diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx b/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx index edae01e0b60439..8ef39fcbc8c734 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx +++ b/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { fireEvent, render, screen } from '@testing-library/react'; +import { fireEvent, render, screen, within } from '@testing-library/react'; import { HttpStart } from '@kbn/core/public'; import React from 'react'; import { @@ -80,9 +80,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + let commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -128,12 +136,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_onPrem') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -164,12 +177,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_onPrem') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -206,12 +224,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_cloud') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_cloud' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -245,12 +268,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Elastic Cloud agent policy') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_policy-elastic-agent-on-cloud') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_policy-elastic-agent-on-cloud' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Elastic Cloud agent policy'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -280,9 +308,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -340,12 +376,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_onPrem') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -379,10 +420,16 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect(component.getByTestId('policySelector_cloud')).toBeInTheDocument(); + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_cloud' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` diff --git a/x-pack/plugins/canvas/public/components/popover/popover.tsx b/x-pack/plugins/canvas/public/components/popover/popover.tsx index 2ef1d4efc10d38..85bf9520b2758d 100644 --- a/x-pack/plugins/canvas/public/components/popover/popover.tsx +++ b/x-pack/plugins/canvas/public/components/popover/popover.tsx @@ -17,7 +17,6 @@ interface Props { ownFocus?: boolean; tooltip?: string; panelClassName?: string; - anchorClassName?: string; anchorPosition?: string; panelPaddingSize?: 'none' | 's' | 'm' | 'l'; id?: string; diff --git a/x-pack/plugins/canvas/shareable_runtime/components/__snapshots__/app.test.tsx.snap b/x-pack/plugins/canvas/shareable_runtime/components/__snapshots__/app.test.tsx.snap index 5d2efe2903bf36..b661ee6e992e7e 100644 --- a/x-pack/plugins/canvas/shareable_runtime/components/__snapshots__/app.test.tsx.snap +++ b/x-pack/plugins/canvas/shareable_runtime/components/__snapshots__/app.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -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.

"`; +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/plugins/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap index db2b294c9074a3..da3ad71c3f0346 100644 --- a/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap +++ b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap @@ -9,7 +9,7 @@ exports[` can navigate Autoplay Settings 1`] = ` aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-hasTransform" + 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;" @@ -102,7 +102,7 @@ exports[` can navigate Autoplay Settings 2`] = ` aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isOpen-hasTransform-top" + class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isOpen-hasTransform-top" data-popover-open="true" data-popover-panel="true" role="dialog" @@ -345,7 +345,7 @@ exports[` can navigate Toolbar Settings, closes when activated 1`] = aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-hasTransform" + 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;" @@ -438,7 +438,7 @@ exports[` can navigate Toolbar Settings, closes when activated 2`] = aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isOpen-hasTransform-top" + class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isOpen-hasTransform-top" data-popover-open="true" data-popover-panel="true" role="dialog" @@ -615,7 +615,7 @@ exports[` can navigate Toolbar Settings, closes when activated 3`] = aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-hasTransform" + 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;" diff --git a/x-pack/plugins/cases/public/components/all_cases/use_actions.test.tsx b/x-pack/plugins/cases/public/components/all_cases/use_actions.test.tsx index dcec2558aad467..e88b5e52c08481 100644 --- a/x-pack/plugins/cases/public/components/all_cases/use_actions.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/use_actions.test.tsx @@ -8,6 +8,10 @@ import userEvent from '@testing-library/user-event'; import { waitFor } from '@testing-library/react'; import { renderHook } from '@testing-library/react-hooks/dom'; +import { + waitForEuiPopoverOpen, + waitForEuiContextMenuPanelTransition, +} from '@elastic/eui/lib/test/rtl'; import { useActions } from './use_actions'; import { basicCase } from '../../containers/mock'; @@ -69,13 +73,12 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByText('Actions')).toBeInTheDocument(); - expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - }); + expect(res.getByText('Actions')).toBeInTheDocument(); + expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); + expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); }); it('change the status of the case', async () => { @@ -89,24 +92,16 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); - }); + userEvent.click(res.getByTestId(`case-action-status-panel-${basicCase.id}`)); + await waitForEuiContextMenuPanelTransition(); - userEvent.click(res.getByTestId(`case-action-status-panel-${basicCase.id}`), undefined, { - skipPointerEventsCheck: true, - }); + expect(res.getByTestId('cases-bulk-action-status-open')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-status-in-progress')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-status-closed')).toBeInTheDocument(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-status-open')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-status-in-progress')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-status-closed')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-status-in-progress'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-status-in-progress')); await waitFor(() => { expect(updateCasesSpy).toHaveBeenCalled(); @@ -124,25 +119,17 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId(`case-action-severity-panel-${basicCase.id}`), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)); + await waitForEuiContextMenuPanelTransition(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-severity-low')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-severity-medium')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-severity-high')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-severity-critical')).toBeInTheDocument(); - }); + expect(res.getByTestId('cases-bulk-action-severity-low')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-severity-medium')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-severity-high')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-severity-critical')).toBeInTheDocument(); - userEvent.click(res.getByTestId('cases-bulk-action-severity-medium'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-severity-medium')); await waitFor(() => { expect(updateCasesSpy).toHaveBeenCalled(); @@ -167,14 +154,9 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-action-copy-id'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-action-copy-id')); expect(navigator.clipboard.writeText).toHaveBeenCalledWith(basicCase.id); @@ -195,14 +177,9 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-delete'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-delete')); await waitFor(() => { expect(res.getByTestId('confirm-delete-case-modal')).toBeInTheDocument(); @@ -224,22 +201,15 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-delete'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-delete')); await waitFor(() => { expect(res.getByTestId('confirm-delete-case-modal')).toBeInTheDocument(); }); - userEvent.click(res.getByTestId('confirmModalCancelButton'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('confirmModalCancelButton')); expect(res.queryByTestId('confirm-delete-case-modal')).toBeFalsy(); }); @@ -257,14 +227,9 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-tags')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-tags'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-tags')); await waitFor(() => { expect(res.getByTestId('cases-edit-tags-flyout')).toBeInTheDocument(); @@ -297,14 +262,9 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-assignees')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-assignees'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-assignees')); await waitFor(() => { expect(res.getByTestId('cases-edit-assignees-flyout')).toBeInTheDocument(); @@ -338,14 +298,13 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - expect(res.getByTestId(`actions-separator-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - }); + expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); + expect(res.getByTestId(`actions-separator-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); }); it('shows the correct actions with no delete permissions', async () => { @@ -358,14 +317,13 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - expect(res.queryByTestId('cases-bulk-action-delete')).toBeFalsy(); - expect(res.queryByTestId(`actions-separator-${basicCase.id}`)).toBeFalsy(); - }); + expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); + expect(res.queryByTestId('cases-bulk-action-delete')).toBeFalsy(); + expect(res.queryByTestId(`actions-separator-${basicCase.id}`)).toBeFalsy(); }); it('shows the correct actions with only delete permissions', async () => { @@ -378,14 +336,13 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.queryByTestId(`case-action-status-panel-${basicCase.id}`)).toBeFalsy(); - expect(res.queryByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeFalsy(); - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - expect(res.queryByTestId(`actions-separator-${basicCase.id}`)).toBeFalsy(); - }); + expect(res.queryByTestId(`case-action-status-panel-${basicCase.id}`)).toBeFalsy(); + expect(res.queryByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeFalsy(); + expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); + expect(res.queryByTestId(`actions-separator-${basicCase.id}`)).toBeFalsy(); }); it('returns null if the user does not have update or delete permissions', async () => { diff --git a/x-pack/plugins/cases/public/components/case_view/components/edit_category.test.tsx b/x-pack/plugins/cases/public/components/case_view/components/edit_category.test.tsx index 33c893d6f6b461..16804fb9580a38 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/edit_category.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/edit_category.test.tsx @@ -242,7 +242,7 @@ describe('EditCategory ', () => { await waitFor(() => { expect(screen.getByTestId('categories-list')).toBeInTheDocument(); - expect(screen.getByText('My category')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue('My category'); }); expect(screen.getByTestId('edit-category-submit')).toBeDisabled(); @@ -265,7 +265,7 @@ describe('EditCategory ', () => { await waitFor(() => { expect(screen.getByTestId('categories-list')).toBeInTheDocument(); - expect(screen.getByText('My category')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue('My category'); }); userEvent.click(screen.getByTestId('edit-category-cancel')); @@ -276,7 +276,7 @@ describe('EditCategory ', () => { await waitFor(() => { expect(screen.getByTestId('categories-list')).toBeInTheDocument(); - expect(screen.getByText('category from the API')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue('category from the API'); }); }); diff --git a/x-pack/plugins/cases/public/components/category/category_component.test.tsx b/x-pack/plugins/cases/public/components/category/category_component.test.tsx index 2b0d7ef39007b9..6eb95600cd58c4 100644 --- a/x-pack/plugins/cases/public/components/category/category_component.test.tsx +++ b/x-pack/plugins/cases/public/components/category/category_component.test.tsx @@ -47,7 +47,7 @@ describe('Category ', () => { it('renders category correctly', () => { render(); - expect(screen.getByText('new-category')).toBeInTheDocument(); + expect(screen.getByRole('combobox')).toHaveValue('new-category'); }); it('renders allow to add new category option', async () => { @@ -56,7 +56,7 @@ describe('Category ', () => { userEvent.type(screen.getByRole('combobox'), 'new{enter}'); expect(onChange).toBeCalledWith('new'); - expect(screen.getByText('new')).toBeInTheDocument(); + expect(screen.getByRole('combobox')).toHaveValue('new'); }); it('renders current option list', async () => { @@ -97,10 +97,10 @@ describe('Category ', () => { expect(onChange).toHaveBeenCalledWith('hi'); }); - userEvent.type(screen.getByRole('combobox'), 'Hi{enter}'); + userEvent.type(screen.getByRole('combobox'), ' there{enter}'); await waitFor(() => { - expect(onChange).toHaveBeenCalledWith('Hi'); + expect(onChange).toHaveBeenCalledWith('hi there'); }); }); }); diff --git a/x-pack/plugins/cases/public/components/create/assignees.test.tsx b/x-pack/plugins/cases/public/components/create/assignees.test.tsx index 9a32ab5f1ffd92..002cd2976f6051 100644 --- a/x-pack/plugins/cases/public/components/create/assignees.test.tsx +++ b/x-pack/plugins/cases/public/components/create/assignees.test.tsx @@ -198,7 +198,7 @@ describe('Assignees', () => { }); act(() => { - userEvent.click(screen.getByText('Turtle')); + userEvent.click(screen.getByText('Turtle'), undefined, { skipPointerEventsCheck: true }); }); // ensure that the similar user is still available for selection diff --git a/x-pack/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts b/x-pack/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts index a109740d74496f..86291929afcc3f 100644 --- a/x-pack/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts +++ b/x-pack/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts @@ -59,9 +59,7 @@ journey('Step Duration series', async ({ page, params }) => { await page.click(byTestId('seriesBreakdown')); await page.click('button[role="option"]:has-text("Step name")'); await page.click('.euiComboBox__inputWrap'); - await page.click( - 'text=Search Monitor nameCombo box. Selected. Combo box input. Search Monitor name. Ty' - ); + await page.click('[role="combobox"][placeholder="Search Monitor name"]'); await page.click('button[role="option"]:has-text("test-monitor - inline")'); await page.click('button:has-text("Apply changes")'); }); diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx index 980c02a0ab1531..17f62937812ee0 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx @@ -39,7 +39,7 @@ describe('Series Builder ReportDefinitionCol', function () { await waitFor(() => { expect(screen.getByText('Web Application')).toBeInTheDocument(); expect(screen.getByText('Environment')).toBeInTheDocument(); - expect(screen.getByText('Search Environment')).toBeInTheDocument(); + expect(screen.getByPlaceholderText('Search Environment')).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx b/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx index 888033d8183cd7..4cf81e2a9976d7 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx @@ -175,7 +175,7 @@ export function FieldValueSelection({ isOpen={isPopoverOpen || forceOpen} closePopover={closePopover} anchorPosition={anchorPosition} - style={{ width: '100%' }} + display="block" > { editPackagePolicyandShowAdvanced(INPUT_TEST_PACKAGE, packagePolicyName); cy.getBySel(POLICY_EDITOR.EDIT_MAPPINGS_BTN).click(); cy.getBySel(CONFIRM_MODAL.CONFIRM_BUTTON).click(); - cy.get('body').should('contain', `logs-${datasetName}@custom`); + cy.get('body').should('contain', `logs${datasetName}@custom`); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.test.tsx index 7850ae3a3128d8..1a18b6e27f5ebc 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { act, fireEvent, waitFor } from '@testing-library/react'; +import { act, fireEvent, waitFor, within } from '@testing-library/react'; import { createFleetTestRendererMock } from '../../../../../../mock'; @@ -54,8 +54,9 @@ describe('AgentUpgradeAgentModal', () => { agentCount: 3, }); - const el = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); - expect(el?.textContent).toBe('Immediately'); + const container = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); + const input = within(container).getByRole('combobox'); + expect(input?.value).toBe('Immediately'); }); it('should set the default to Immediately if there is less than 10 agents using selected agents', async () => { @@ -64,8 +65,9 @@ describe('AgentUpgradeAgentModal', () => { agentCount: 3, }); - const el = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); - expect(el?.textContent).toBe('Immediately'); + const container = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); + const input = within(container).getByRole('combobox'); + expect(input?.value).toBe('Immediately'); }); it('should set the default to 1 hour if there is more than 10 agents', async () => { @@ -74,8 +76,9 @@ describe('AgentUpgradeAgentModal', () => { agentCount: 13, }); - const el = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); - expect(el?.textContent).toBe('1 hour'); + const container = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); + const input = within(container).getByRole('combobox'); + expect(input?.value).toBe('1 hour'); }); }); @@ -98,9 +101,11 @@ describe('AgentUpgradeAgentModal', () => { agentCount: 1, }); - const el = utils.getByTestId('agentUpgradeModal.VersionCombobox'); + const container = utils.getByTestId('agentUpgradeModal.VersionCombobox'); + const input = within(container).getByRole('combobox'); + await waitFor(() => { - expect(el.textContent).toEqual('8.10.2'); + expect(input?.value).toEqual('8.10.2'); }); }); diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx index 0e85390a4b3274..214ce24463e547 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx @@ -125,8 +125,7 @@ export const GridColumn = ({ // Ensure that cards wrapped in EuiTours/EuiPopovers correctly inherit the full grid row height css={css` & > .euiPopover, - & > .euiPopover > .euiPopover__anchor, - & > .euiPopover > .euiPopover__anchor > .euiCard { + & > .euiPopover > .euiCard { height: 100%; } `} diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/helpers/actions/toggle_phase_action.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/helpers/actions/toggle_phase_action.ts index fc89332e47a67c..7af36c2fb4f1d5 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/helpers/actions/toggle_phase_action.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/helpers/actions/toggle_phase_action.ts @@ -27,7 +27,7 @@ const toggleDeletePhase = async (testBed: TestBed) => { if (action === 'disable') { button.simulate('click'); } else { - button.find('input').simulate('change'); + button.find('button').simulate('click'); } }); component.update(); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx index 9102d2b5e307f0..3698d07018c712 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx @@ -377,7 +377,9 @@ describe('Test pipeline', () => { // Click the "Configuration" tab await actions.clickProcessorConfigurationTab(); // Verify type selector has not changed - expect(find('processorTypeSelector.input').text()).toBe('Set'); + expect(find('processorTypeSelector.input').find('[role="combobox"]').props().value).toBe( + 'Set' + ); }); }); diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx index 554f34325016f0..155f4236f81072 100644 --- a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx +++ b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx @@ -40,24 +40,26 @@ describe('TreeNav component', () => { it('mount with Logical View selected by default', async () => { renderResult = mockedContext.render(); - const elemLabel = await renderResult.getByDisplayValue(/logical/i); - expect(elemLabel).toBeChecked(); + const elemLabel = await renderResult.getByTestId('treeNavType_generated-idlogical'); + expect(elemLabel).toHaveAttribute('aria-pressed', 'true'); }); it('shows the tree path according with the selected view type', async () => { renderResult = mockedContext.render(); const logicalViewPath = 'cluster / namespace / pod / container image'; - const logicViewRadio = await renderResult.getByDisplayValue(/logical/i); - expect(logicViewRadio).toBeChecked(); + const logicViewButton = renderResult.getByTestId('treeNavType_generated-idlogical'); + expect(logicViewButton).toHaveAttribute('aria-pressed', 'true'); expect(renderResult.getByText(logicalViewPath)).toBeInTheDocument(); - const infraStructureViewRadio = await renderResult.getByDisplayValue(/infrastructure/i); + const infraStructureViewRadio = renderResult.getByTestId( + 'treeNavType_generated-idinfrastructure' + ); infraStructureViewRadio.click(); expect(renderResult.getByText('cluster / node / pod / container image')).toBeInTheDocument(); - logicViewRadio.click(); + logicViewButton.click(); expect(renderResult.getByText(logicalViewPath)).toBeInTheDocument(); }); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filter_popover.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filter_popover.tsx index 4e3fe6336be9e0..35327fb91b6781 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filter_popover.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filter_popover.tsx @@ -53,7 +53,6 @@ export const FilterPopover = ({ return ( { userEvent.type(customPrefixTextbox, prefix); }; return { - settingNone: screen.getByLabelText(/none/i), - settingAuto: screen.getByLabelText(/auto/i), - settingCustom: screen.getByLabelText(/custom/i), + settingNone: screen.getByTitle(/none/i), + settingAuto: screen.getByTitle(/auto/i), + settingCustom: screen.getByTitle(/custom/i), customPrefixTextbox, typePrefix, ...rtlRender, @@ -276,9 +276,9 @@ describe('dimension editor', () => { state: localState, }); - expect(settingAuto).toBeChecked(); - expect(settingNone).not.toBeChecked(); - expect(settingCustom).not.toBeChecked(); + expect(settingAuto).toHaveAttribute('aria-pressed', 'true'); + expect(settingNone).toHaveAttribute('aria-pressed', 'false'); + expect(settingCustom).toHaveAttribute('aria-pressed', 'false'); expect(customPrefixTextbox).not.toBeInTheDocument(); }); @@ -286,9 +286,9 @@ describe('dimension editor', () => { const { settingAuto, settingCustom, settingNone, customPrefixTextbox } = renderSecondaryMetricEditor({ state: { ...localState, secondaryPrefix: NONE_PREFIX } }); - expect(settingNone).toBeChecked(); - expect(settingAuto).not.toBeChecked(); - expect(settingCustom).not.toBeChecked(); + expect(settingNone).toHaveAttribute('aria-pressed', 'true'); + expect(settingAuto).toHaveAttribute('aria-pressed', 'false'); + expect(settingCustom).toHaveAttribute('aria-pressed', 'false'); expect(customPrefixTextbox).not.toBeInTheDocument(); }); @@ -297,9 +297,9 @@ describe('dimension editor', () => { const { settingAuto, settingCustom, settingNone, customPrefixTextbox } = renderSecondaryMetricEditor({ state: customPrefixState }); - expect(settingAuto).not.toBeChecked(); - expect(settingNone).not.toBeChecked(); - expect(settingCustom).toBeChecked(); + expect(settingAuto).toHaveAttribute('aria-pressed', 'false'); + expect(settingNone).toHaveAttribute('aria-pressed', 'false'); + expect(settingCustom).toHaveAttribute('aria-pressed', 'true'); expect(customPrefixTextbox).toHaveValue(customPrefixState.secondaryPrefix); }); @@ -454,11 +454,10 @@ describe('dimension editor', () => { ); const supportingVisOptions = { - none: screen.queryByLabelText(/none/i), + none: screen.queryByTitle(/none/i), // in eui when bar or line become disabled they change from input to button so we have to do this weird check - bar: screen.queryByLabelText(/bar/i) || screen.queryByRole('button', { name: /bar/i }), - trendline: - screen.queryByLabelText(/line/i) || screen.queryByRole('button', { name: /line/i }), + bar: screen.queryByTitle(/bar/i) || screen.queryByRole('button', { name: /bar/i }), + trendline: screen.queryByTitle(/line/i) || screen.queryByRole('button', { name: /line/i }), }; const clickOnSupportingVis = (type: SupportingVisType) => { @@ -472,8 +471,8 @@ describe('dimension editor', () => { return { progressDirectionShowing: screen.queryByTestId('lnsMetric_progress_direction_buttons'), progressOptions: { - vertical: screen.queryByLabelText(/vertical/i), - horizontal: screen.queryByLabelText(/horizontal/i), + vertical: screen.queryByTitle(/vertical/i), + horizontal: screen.queryByTitle(/horizontal/i), }, supportingVisOptions, clickOnSupportingVis, @@ -501,21 +500,21 @@ describe('dimension editor', () => { const { supportingVisOptions } = renderAdditionalSectionEditor({ state: { ...stateWOTrend, showBar: false, maxAccessor: undefined }, }); - expect(supportingVisOptions.none).toBeChecked(); + expect(supportingVisOptions.none).toHaveAttribute('aria-pressed', 'true'); }); it('when `showBar` is true and maximum value is not defined, bar should be selected', () => { const { supportingVisOptions } = renderAdditionalSectionEditor({ state: { ...stateWOTrend, showBar: true }, }); - expect(supportingVisOptions.bar).toBeChecked(); + expect(supportingVisOptions.bar).toHaveAttribute('aria-pressed', 'true'); }); it('when `showBar` is true and trendline is defined, line should be selected', () => { const { supportingVisOptions } = renderAdditionalSectionEditor({ state: metricAccessorState, }); - expect(supportingVisOptions.trendline).toBeChecked(); + expect(supportingVisOptions.trendline).toHaveAttribute('aria-pressed', 'true'); }); it('should enable bar when max dimension exists', () => { @@ -633,10 +632,10 @@ describe('dimension editor', () => { state: metricAccessorState, }); - expect(progressOptions.vertical).toBeChecked(); - expect(progressOptions.horizontal).not.toBeChecked(); + expect(progressOptions.vertical).toHaveAttribute('aria-pressed', 'true'); + expect(progressOptions.horizontal).toHaveAttribute('aria-pressed', 'false'); if (progressOptions.horizontal === null) { - throw new Error('horizontal radio button not found'); + throw new Error('horizontal button not found'); } userEvent.click(progressOptions.horizontal); diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx index 5c2bfb90456889..f6b8bff8c09ab7 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx @@ -264,11 +264,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual('is'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldMatch"]').text()).toEqual( - '1234' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatchLabel"] input').props().value + ).toEqual('1234'); }); test('it renders field values correctly when operator is "isNotOperator"', () => { @@ -299,13 +303,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is not' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldMatch"]').text()).toEqual( - '1234' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is not'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatchLabel"] input').props().value + ).toEqual('1234'); }); test('it renders field values correctly when operator is "isOneOfOperator"', () => { @@ -336,11 +342,13 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is one of' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldMatchAny"]').text()).toEqual( + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is one of'); + expect(wrapper.find('[data-test-subj="valuesAutocompleteMatchAny"]').first().text()).toEqual( '1234' ); }); @@ -373,10 +381,12 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is not one of' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is not one of'); expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldMatchAny"]').text()).toEqual( '1234' ); @@ -411,12 +421,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is in list' - ); expect( - wrapper.find('[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]').at(1).text() + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is in list'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input').props() + .value ).toEqual('some name'); }); @@ -449,12 +462,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is not in list' - ); expect( - wrapper.find('[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]').at(1).text() + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is not in list'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input').props() + .value ).toEqual('some name'); }); @@ -486,11 +502,16 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'exists' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldExists"]').text()).toEqual('—'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"] input').props().value + ).toEqual('exists'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteComboBox existsComboxBox"] input').props() + .placeholder + ).toEqual('—'); expect( wrapper.find('[data-test-subj="exceptionBuilderEntryFieldExists"] input').props().disabled ).toBeTruthy(); @@ -524,11 +545,16 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'does not exist' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldExists"]').text()).toEqual('—'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"] input').props().value + ).toEqual('does not exist'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteComboBox existsComboxBox"] input').props() + .placeholder + ).toEqual('—'); expect( wrapper.find('[data-test-subj="exceptionBuilderEntryFieldExists"] input').props().disabled ).toBeTruthy(); @@ -562,13 +588,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('@tags'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'matches' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldWildcard"]').text()).toEqual( - '1234*' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('@tags'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"] input').props().value + ).toEqual('matches'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').props().value + ).toEqual('1234*'); // doesnt show warning label for non endpoint exception items expect( wrapper.find('[data-test-subj="valuesAutocompleteWildcardLabel"] .euiFormHelpText') @@ -637,13 +665,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('@tags'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'does not match' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldWildcard"]').text()).toEqual( - '1234*' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('@tags'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"] input').props().value + ).toEqual('does not match'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').props().value + ).toEqual('1234*'); }); test('it uses "correspondingKeywordField" if it exists', () => { diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx index 37262749ce55af..2bb1ebc275b084 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx @@ -58,18 +58,20 @@ describe('ExceptionBuilderComponent', () => { ); + // console.log(wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').html()); + expect(wrapper.find('EuiFlexGroup[data-test-subj="exceptionItemEntryContainer"]')).toHaveLength( 1 ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(wrapper.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + wrapper.find('[data-test-subj="fieldAutocompleteComboBox"] input').props().placeholder + ).toEqual('Search'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').props().placeholder + ).toEqual('Please select a field first...'); }); test('it displays "exceptionListItems" that are passed in', async () => { @@ -103,15 +105,16 @@ describe('ExceptionBuilderComponent', () => { /> ); + expect(wrapper.find('EuiFlexGroup[data-test-subj="exceptionItemEntryContainer"]')).toHaveLength( 1 ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'ip' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is one of' - ); + expect( + wrapper.find('[data-test-subj="fieldAutocompleteComboBox"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is one of'); expect(wrapper.find('[data-test-subj="valuesAutocompleteMatchAny"]').at(0).text()).toEqual( 'some ip' ); @@ -263,25 +266,27 @@ describe('ExceptionBuilderComponent', () => { expect( wrapper.find('EuiFlexGroup[data-test-subj="exceptionItemEntryContainer"]') ).toHaveLength(2); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(wrapper.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props() + .placeholder + ).toEqual('Search'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().placeholder + ).toEqual('Please select a field first...'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(1).text()).toEqual( - 'Search' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(1).text()).toEqual( - 'is' - ); - expect(wrapper.find('[data-test-subj="valuesAutocompleteMatch"]').at(1).text()).toEqual( - 'Please select a field first...' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').at(1).props() + .placeholder + ).toEqual('Search'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(1).props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(1).props().placeholder + ).toEqual('Please select a field first...'); }); }); @@ -324,25 +329,25 @@ describe('ExceptionBuilderComponent', () => { const item1 = wrapper.find('EuiFlexGroup[data-test-subj="exceptionEntriesContainer"]').at(0); const item2 = wrapper.find('EuiFlexGroup[data-test-subj="exceptionEntriesContainer"]').at(1); - expect(item1.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(item1.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(item1.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + item1.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect( + item1.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + expect( + item1.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().placeholder + ).toEqual('Please select a field first...'); - expect(item2.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(item2.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(item2.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + item2.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect( + item2.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + expect( + item2.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().placeholder + ).toEqual('Please select a field first...'); }); }); @@ -378,27 +383,27 @@ describe('ExceptionBuilderComponent', () => { ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'ip' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is one of' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is one of'); expect(wrapper.find('[data-test-subj="valuesAutocompleteMatchAny"]').at(0).text()).toEqual( 'some ip' ); wrapper.find('[data-test-subj="firstRowBuilderDeleteButton"] button').simulate('click'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(wrapper.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().placeholder + ).toEqual('Please select a field first...'); }); test('it displays "and" badge if at least one exception item includes more than one entry', () => { @@ -507,14 +512,17 @@ describe('ExceptionBuilderComponent', () => { const entry2 = wrapper .find('EuiFlexGroup[data-test-subj="exceptionItemEntryContainer"]') .at(1); - expect(entry2.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search nested field' - ); - expect(entry2.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); + + expect( + entry2.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props() + .placeholder + ).toEqual('Search nested field'); + expect( + entry2.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); expect( - entry2.find('[data-test-subj="exceptionBuilderEntryFieldExists"]').at(0).text() + entry2.find('[data-test-subj="exceptionBuilderEntryFieldExists"] input').at(0).props() + .placeholder ).toEqual(getEmptyValue()); }); }); diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss index 959176547dfb25..c88f343f7dbfa1 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss @@ -81,7 +81,6 @@ flex-grow: 1; } -.mapLayTocActions__popoverAnchor, .mapLayTocActions__tooltipAnchor { max-width: 100%; } diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/__snapshots__/toc_entry_actions_popover.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/__snapshots__/toc_entry_actions_popover.test.tsx.snap index dfa4200c8508e4..47171e8bbe871b 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/__snapshots__/toc_entry_actions_popover.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/__snapshots__/toc_entry_actions_popover.test.tsx.snap @@ -3,7 +3,6 @@ exports[`TOCEntryActionsPopover is rendered 1`] = ` { closePopover={this._closePopover} panelPaddingSize="none" anchorPosition="leftUp" - anchorClassName="mapLayTocActions__popoverAnchor" > { // Check the Single Metric Viewer element exists in the selector, and that it is checked. expect(getByTestId('mlAnomalyResultsViewSelectorSingleMetricViewer')).toBeInTheDocument(); - expect( - getByTestId('mlAnomalyResultsViewSelectorSingleMetricViewer') - .querySelector('input')! - .hasAttribute('checked') - ).toBe(true); + expect(getByTestId('mlAnomalyResultsViewSelectorSingleMetricViewer')).toHaveAttribute( + 'aria-pressed', + 'true' + ); }); }); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap index b5cc6f0e7ecc09..aadc12d246169e 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap @@ -26,26 +26,22 @@ exports[`Node Listing Metric Cell should format a non-percentage metric 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+
-
- -
+
{ cy.contains("SELECT * FROM os_version where name='{{host.os.name}}';"); - cy.contains('host.os.platform'); + cy.get('input[value="host.os.platform"]').should('exist'); cy.contains('platform'); }); cy.getBySel(RESPONSE_ACTIONS_ITEM_1).within(() => { diff --git a/x-pack/plugins/osquery/cypress/e2e/all/alerts_multiple_agents.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/alerts_multiple_agents.cy.ts index afea9bb8c0adf7..ca10dc80fe6b6c 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/alerts_multiple_agents.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/alerts_multiple_agents.cy.ts @@ -49,7 +49,7 @@ describe( // This is probably due to the tokenization of the fields when it's inactive cy.get(OSQUERY_FLYOUT_BODY_EDITOR).click(); cy.getBySel('flyout-body-osquery').contains("SELECT * FROM os_version where name='Ubuntu';"); - cy.getBySel('flyout-body-osquery').contains('host.os.platform'); + cy.getBySel('flyout-body-osquery').find('input[value="host.os.platform"]').should('exist'); cy.getBySel('flyout-body-osquery').contains('platform'); }); diff --git a/x-pack/plugins/osquery/cypress/e2e/all/alerts_response_actions_form.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/alerts_response_actions_form.cy.ts index f0d3c3468f16c9..0591e650cc560f 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/alerts_response_actions_form.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/alerts_response_actions_form.cy.ts @@ -157,8 +157,8 @@ describe('Alert Event Details - Response Actions Form', { tags: ['@ess', '@serve cy.contains('Days of uptime'); }); cy.getBySel(RESPONSE_ACTIONS_ITEM_1).within(() => { - cy.contains(packName); - cy.getBySel('comboBoxInput').type('{backspace}{enter}'); + cy.getBySel('comboBoxSearchInput').should('have.value', packName); + cy.getBySel('comboBoxInput').type('{selectall}{backspace}{enter}'); }); cy.getBySel(RESPONSE_ACTIONS_ITEM_0).within(() => { cy.contains('select * from uptime1'); @@ -166,6 +166,7 @@ describe('Alert Event Details - Response Actions Form', { tags: ['@ess', '@serve }); cy.getBySel(RESPONSE_ACTIONS_ITEM_0) .within(() => { + cy.getBySel('comboBoxSearchInput').click(); cy.contains('Search for a pack to run'); cy.contains('Pack is a required field'); cy.getBySel('comboBoxInput').type(`${packName}{downArrow}{enter}`); @@ -201,8 +202,10 @@ describe('Alert Event Details - Response Actions Form', { tags: ['@ess', '@serve cy.getBySel('edit-rule-actions-tab').click(); cy.getBySel(RESPONSE_ACTIONS_ITEM_0) .within(() => { - cy.contains(packName); - cy.getBySel('comboBoxInput').type(`${multiQueryPackName}{downArrow}{enter}`); + cy.getBySel('comboBoxSearchInput').should('have.value', packName); + cy.getBySel('comboBoxInput').type( + `{selectall}{backspace}${multiQueryPackName}{downArrow}{enter}` + ); cy.contains('SELECT * FROM memory_info;'); cy.contains('SELECT * FROM system_info;'); }) diff --git a/x-pack/plugins/osquery/cypress/e2e/all/packs_integration.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/packs_integration.cy.ts index 9e10e1eb0d889e..8a972405015c99 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/packs_integration.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/packs_integration.cy.ts @@ -86,7 +86,7 @@ describe('ALL - Packs', { tags: ['@ess', '@serverless'] }, () => { cy.visit(FLEET_AGENT_POLICIES); cy.contains(AGENT_POLICY_NAME).click(); cy.get('.euiTableCellContent') - .get('.euiPopover__anchor') + .get('.euiPopover') .get(`[aria-label="Open"]`) .first() .click(); @@ -308,14 +308,12 @@ describe('ALL - Packs', { tags: ['@ess', '@serverless'] }, () => { cy.getBySel(EDIT_PACK_HEADER_BUTTON).click(); cy.get('#shardsPercentage0').should('have.value', '15'); cy.getBySel('packShardsForm-1').within(() => { - cy.getBySel('shards-field-policy').contains(OSQUERY_POLICY); + cy.getBySel('shards-field-policy').find('input').should('value', OSQUERY_POLICY); cy.get('#shardsPercentage1').should('have.value', '0'); }); - cy.getBySel(POLICY_SELECT_COMBOBOX).within(() => { - cy.contains(OSQUERY_POLICY).should('not.exist'); - }); + cy.getBySel(POLICY_SELECT_COMBOBOX).find('input').should('not.have.value', OSQUERY_POLICY); - cy.getBySel('comboBoxInput').contains(OSQUERY_POLICY).should('exist'); + cy.getBySel('shards-field-policy').find(`input[value="${OSQUERY_POLICY}"]`).should('exist'); cy.getBySel(POLICY_SELECT_COMBOBOX).click(); cy.get('[data-test-subj="packShardsForm-1"]').within(() => { cy.get(`[aria-label="Delete shards row"]`).click(); diff --git a/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts b/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts index d512f5d5df5bb8..afa0482c90a26f 100644 --- a/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts @@ -79,7 +79,9 @@ describe(`T1 and T2 analysts`, { tags: ['@ess', '@serverless'] }, () => { cy.contains(liveQueryQuery); cy.get(`[aria-label="Run query"]`).first().should('not.be.disabled'); cy.get(`[aria-label="Run query"]`).first().click(); - cy.contains(savedQueryName); + cy.get('[data-test-subj="savedQuerySelect"]') + .find('input') + .should('have.value', savedQueryName); submitQuery(); checkResults(); }); diff --git a/x-pack/plugins/reporting/public/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap b/x-pack/plugins/reporting/public/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap index 06ae63fee31288..16b666d519c467 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap +++ b/x-pack/plugins/reporting/public/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap @@ -134,7 +134,7 @@ exports[`ScreenCapturePanelContent properly renders a view with "canvas" layout class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="advanced-options" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -331,7 +331,7 @@ exports[`ScreenCapturePanelContent properly renders a view with "print" layout o class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="advanced-options" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -469,7 +469,7 @@ exports[`ScreenCapturePanelContent renders the default view properly 1`] = ` class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="advanced-options" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx index e336d75969246f..e0b0156db75686 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx @@ -197,7 +197,7 @@ describe('', () => { const featurePrivilegeToggles = wrapper.find(EuiButtonGroup); expect(featurePrivilegeToggles).toHaveLength(1); - expect(featurePrivilegeToggles.find('input')).toHaveLength(3); + expect(featurePrivilegeToggles.find('button')).toHaveLength(3); (featurePrivilegeToggles.props() as EuiButtonGroupProps).onChange('feature1_all', null); diff --git a/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts b/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts index 6350641bf5da30..d2fa41f6d1c1f5 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts +++ b/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts @@ -80,41 +80,37 @@ describe('SecurityNavControlService', () => { data-test-subj="kbnRedirectAppLink" >
- + +
diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap index c676809c3c2a56..d22fb49ab6627b 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap @@ -82,33 +82,29 @@ exports[`Event Details Overview Cards renders rows and spacers correctly 1`] = ` class="c2" >
-
- -
+ + +
{ ); expect(wrapper.find('EuiFlexGroup[data-test-subj="itemEntryContainer"]')).toHaveLength(1); - expect(wrapper.find('[data-test-subj="entryField"]').text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').text()).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').props().placeholder).toEqual( + 'Search' + ); + expect(wrapper.find('[data-test-subj="threatEntryField"] input').props().placeholder).toEqual( + 'Search' + ); }); test('it displays "Search" for "listItems" that are passed in', async () => { @@ -108,7 +112,9 @@ describe('ThreatMatchComponent', () => { ); expect(wrapper.find('EuiFlexGroup[data-test-subj="itemEntryContainer"]')).toHaveLength(1); - expect(wrapper.find('[data-test-subj="entryField"]').at(0).text()).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(0).props().placeholder).toEqual( + 'Search' + ); wrapper.unmount(); }); @@ -171,10 +177,18 @@ describe('ThreatMatchComponent', () => { await waitFor(() => { expect(wrapper.find('EuiFlexGroup[data-test-subj="itemEntryContainer"]')).toHaveLength(2); - expect(wrapper.find('[data-test-subj="entryField"]').at(0).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').at(0).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="entryField"]').at(1).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').at(1).text()).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(0).props().placeholder).toEqual( + 'Search' + ); + expect( + wrapper.find('[data-test-subj="threatEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(1).props().placeholder).toEqual( + 'Search' + ); + expect( + wrapper.find('[data-test-subj="threatEntryField"] input').at(1).props().placeholder + ).toEqual('Search'); }); }); @@ -208,10 +222,18 @@ describe('ThreatMatchComponent', () => { await waitFor(() => { expect(wrapper.find('EuiFlexGroup[data-test-subj="entriesContainer"]')).toHaveLength(2); - expect(wrapper.find('[data-test-subj="entryField"]').at(0).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').at(0).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="entryField"]').at(1).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').at(1).text()).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(0).props().placeholder).toEqual( + 'Search' + ); + expect( + wrapper.find('[data-test-subj="threatEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(1).props().placeholder).toEqual( + 'Search' + ); + expect( + wrapper.find('[data-test-subj="threatEntryField"] input').at(1).props().placeholder + ).toEqual('Search'); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx index e9082e2ca72a9d..24f813cf81a5cb 100644 --- a/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx @@ -65,21 +65,21 @@ describe('useEuiComboBoxReset', () => { render(); - const initialValue = screen.getByTestId('comboBoxInput'); // EuiComboBox does NOT render the current selection via it's input; it uses this div - expect(initialValue).toHaveTextContent(options[0].label); + const initialValue = screen.getByRole('combobox'); + expect(initialValue).toHaveValue(options[0].label); // update the EuiComboBox input to an invalid value: - const searchInput = screen.getByTestId('comboBoxSearchInput'); // the actual controlled by EuiComboBox + const searchInput = screen.getByRole('combobox'); // the actual controlled by EuiComboBox fireEvent.change(searchInput, { target: { value: invalidValue } }); - const afterInvalidInput = screen.getByTestId('comboBoxInput'); + const afterInvalidInput = screen.getByRole('combobox'); expect(searchInput).toHaveValue(invalidValue); // the EuiComboBox is now in the "error state" expect(afterInvalidInput).not.toHaveTextContent(invalidValue); // Value should not have been applied const resetButton = screen.getByRole('button', { name: 'Reset' }); fireEvent.click(resetButton); // clicking invokes onReset() - const afterReset = screen.getByTestId('comboBoxInput'); - expect(afterReset).toHaveTextContent(options[0].label); // back to the default + const afterReset = screen.getByRole('combobox'); + expect(afterReset).toHaveValue(options[0].label); // back to the default }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx b/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx index 85b1def4c41018..509d7610cb0fb2 100644 --- a/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx @@ -11,20 +11,12 @@ import { IS_DRAGGING_CLASS_NAME, } from '@kbn/securitysolution-t-grid'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import styled from 'styled-components'; /** * To avoid expensive changes to the DOM, delay showing the popover menu */ const HOVER_INTENT_DELAY = 100; // ms -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const WithHoverActionsPopover = styled(EuiPopover as any)` - .euiPopover__anchor { - width: 100%; - } -` as unknown as typeof EuiPopover; - interface Props { /** * Always show the hover menu contents (default: false) @@ -157,7 +149,7 @@ export const WithHoverActions = React.memo( className={alwaysShow ? HOVER_ACTIONS_ALWAYS_SHOW_CLASS_NAME : ''} onMouseLeave={onMouseLeave} > - ( repositionOnScroll={true} > {isOpen ?
{hoverContent}
: null} -
+
); } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx index 75d132b7616543..b23786f07f379f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx @@ -14,8 +14,7 @@ import * as i18n from '../../../../../detections/pages/detection_engine/rules/tr const SearchBarWrapper = styled(EuiFlexItem)` min-width: 200px; - & .euiPopover, - & .euiPopover__anchor { + & .euiPopover { // This is needed to "cancel" styles passed down from EuiTourStep that // interfere with EuiFieldSearch and don't allow it to take the full width display: block; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx index 8ec9c52e0b773a..e1a6440edd0d00 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx @@ -148,11 +148,7 @@ describe('StepAboutRuleToggleDetails', () => { expect(wrapper.find('[idSelected="details"]').exists()).toBeTruthy(); expect(wrapper.find('[idSelected="notes"]').exists()).toBeFalsy(); - wrapper - .find('[title="Investigation guide"]') - .at(0) - .find('input') - .simulate('change', { target: { value: 'notes' } }); + wrapper.find('button[title="Investigation guide"]').simulate('click'); expect(wrapper.find('[idSelected="details"]').exists()).toBeFalsy(); expect(wrapper.find('[idSelected="notes"]').exists()).toBeTruthy(); @@ -174,11 +170,7 @@ describe('StepAboutRuleToggleDetails', () => { ); - wrapper - .find('[title="Investigation guide"]') - .at(0) - .find('input') - .simulate('change', { target: { value: 'notes' } }); + wrapper.find('button[title="Investigation guide"]').simulate('click'); expect(wrapper.find('EuiButtonGroup[idSelected="notes"]').exists()).toBeTruthy(); expect(wrapper.find('div.euiMarkdownFormat').text()).toEqual( @@ -254,11 +246,7 @@ describe('StepAboutRuleToggleDetails', () => { expect(wrapper.find('[idSelected="notes"]').exists()).toBeFalsy(); expect(wrapper.find('[idSelected="setup"]').exists()).toBeFalsy(); - wrapper - .find('[title="Setup guide"]') - .at(0) - .find('input') - .simulate('change', { target: { value: 'setup' } }); + wrapper.find('button[title="Setup guide"]').simulate('click'); expect(wrapper.find('[idSelected="details"]').exists()).toBeFalsy(); expect(wrapper.find('[idSelected="notes"]').exists()).toBeFalsy(); @@ -281,11 +269,7 @@ describe('StepAboutRuleToggleDetails', () => { ); - wrapper - .find('[title="Setup guide"]') - .at(0) - .find('input') - .simulate('change', { target: { value: 'setup' } }); + wrapper.find('button[title="Setup guide"]').simulate('click'); expect(wrapper.find('EuiButtonGroup[idSelected="setup"]').exists()).toBeTruthy(); expect(wrapper.find('div.euiMarkdownFormat').text()).toEqual( diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.test.tsx index b38f10994eb131..c8707897d18a88 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.test.tsx @@ -393,16 +393,15 @@ describe('StepDefineRule', () => { ); expect(getByTestId(`eqlQueryBarTextInput`).textContent).toEqual(eqlQuery.queryBar.query.query); fireEvent.click(getByTestId(`eql-settings-trigger`)); - expect( - within(getByTestId(`eql-event-category-field`)).queryByText( - eqlQuery.eqlOptions.eventCategoryField - ) - ).toBeInTheDocument(); - expect( - within(getByTestId(`eql-tiebreaker-field`)).queryByText(eqlQuery.eqlOptions.tiebreakerField) - ).toBeInTheDocument(); - expect( - within(getByTestId(`eql-timestamp-field`)).queryByText(eqlQuery.eqlOptions.timestampField) - ).toBeInTheDocument(); + + expect(within(getByTestId(`eql-event-category-field`)).queryByRole('combobox')).toHaveValue( + eqlQuery.eqlOptions.eventCategoryField + ); + expect(within(getByTestId(`eql-tiebreaker-field`)).queryByRole('combobox')).toHaveValue( + eqlQuery.eqlOptions.tiebreakerField + ); + expect(within(getByTestId(`eql-timestamp-field`)).queryByRole('combobox')).toHaveValue( + eqlQuery.eqlOptions.timestampField + ); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/index.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/index.test.tsx index d5e956da14c0ee..4d7798a4fcbe67 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/index.test.tsx @@ -62,23 +62,33 @@ describe('ChartSelect', () => { ); expect(screen.getByTestId('chart-select-tabs')).toBeInTheDocument(); - expect(screen.getByTestId('trend')).toBeChecked(); + expect(screen.getByTitle('Trend')).toHaveAttribute('aria-pressed', 'true'); }); - test('changing selection render correctly when alertsPageChartsEnabled is true', async () => { + test('changing selection render correctly when alertsPageChartsEnabled is true', () => { mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); const setAlertViewSelection = jest.fn(); - const { container } = render( + const { rerender } = render( ); - const button = container.querySelector('input[value="treemap"]'); - if (button) { - fireEvent.change(button, { target: { checked: true, type: 'radio' } }); - } - expect(screen.getByTestId('treemap')).toBeChecked(); - expect(screen.getByTestId('trend')).not.toBeChecked(); + expect(screen.getByTitle('Trend')).toHaveAttribute('aria-pressed', 'true'); + + const treemapButton = screen.getByTitle('Treemap'); + expect(treemapButton).toHaveAttribute('aria-pressed', 'false'); + + fireEvent.click(treemapButton); + expect(setAlertViewSelection).toHaveBeenCalledWith('treemap'); + + rerender( + + + + ); + + expect(screen.getByTitle('Treemap')).toHaveAttribute('aria-pressed', 'true'); + expect(screen.getByTitle('Trend')).toHaveAttribute('aria-pressed', 'false'); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx index 07f07df47d8884..feb8b0ead2be48 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx @@ -245,22 +245,21 @@ describe('ChartPanels', () => { ); - const initialValue = screen.getAllByTestId('comboBoxInput')[0]; // EuiComboBox does NOT render the current selection via it's input; it uses this div - expect(initialValue).toHaveTextContent(defaultValue); + const initialInput = screen.getAllByTestId('comboBoxSearchInput')[0]; + expect(initialInput).toHaveValue(defaultValue); // update the EuiComboBox input to an invalid value: - const searchInput = screen.getAllByTestId('comboBoxSearchInput')[0]; // the actual controlled by EuiComboBox - fireEvent.change(searchInput, { target: { value: invalidValue } }); + fireEvent.change(initialInput, { target: { value: invalidValue } }); - const afterInvalidInput = screen.getAllByTestId('comboBoxInput')[0]; - expect(searchInput).toHaveValue(invalidValue); // the 'Group by' EuiComboBox is now in the "error state" - expect(afterInvalidInput).not.toHaveTextContent(invalidValue); // Value should not have been applied + const afterInvalidInput = screen.getAllByTestId('comboBoxSearchInput')[0]; + expect(afterInvalidInput).toHaveValue(invalidValue); // the 'Group by' EuiComboBox is now in the "error state" + expect(afterInvalidInput).toBeInvalid(); resetGroupByFields(); // invoke the `Reset group by fields` context menu action await waitFor(() => { - const afterReset = screen.getAllByTestId('comboBoxInput')[0]; - expect(afterReset).toHaveTextContent(defaultValue); // back to the default + const afterReset = screen.getAllByTestId('comboBoxSearchInput')[0]; + expect(afterReset).toHaveValue(defaultValue); // back to the default }); }); }); @@ -285,22 +284,21 @@ describe('ChartPanels', () => { ); - const initialValue = screen.getAllByTestId('comboBoxInput')[1]; // EuiComboBox does NOT render the current selection via it's input; it uses this div - expect(initialValue).toHaveTextContent(defaultValue); + const initialInput = screen.getAllByTestId('comboBoxSearchInput')[1]; + expect(initialInput).toHaveValue(defaultValue); // update the EuiComboBox input to an invalid value: - const searchInput = screen.getAllByTestId('comboBoxSearchInput')[1]; // the actual controlled by EuiComboBox - fireEvent.change(searchInput, { target: { value: invalidValue } }); + fireEvent.change(initialInput, { target: { value: invalidValue } }); - const afterInvalidInput = screen.getAllByTestId('comboBoxInput')[1]; - expect(searchInput).toHaveValue(invalidValue); // the 'Group by top' EuiComboBox is now in the "error state" - expect(afterInvalidInput).not.toHaveTextContent(invalidValue); // Value should not have been applied + const afterInvalidInput = screen.getAllByTestId('comboBoxSearchInput')[1]; + expect(afterInvalidInput).toHaveValue(invalidValue); // the 'Group by top' EuiComboBox is now in the "error state" + expect(afterInvalidInput).toBeInvalid(); resetGroupByFields(); // invoke the `Reset group by fields` context menu action await waitFor(() => { - const afterReset = screen.getAllByTestId('comboBoxInput')[1]; - expect(afterReset).toHaveTextContent(defaultValue); // back to the default + const afterReset = screen.getAllByTestId('comboBoxSearchInput')[1]; + expect(afterReset).toHaveValue(defaultValue); // back to the default }); }); }); diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap b/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap index cebd8a483aafba..b0b2754c24d3bc 100644 --- a/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap @@ -374,32 +374,28 @@ exports[`Authentication Host Table Component rendering it renders the host authe class="euiFlexItem emotion-euiFlexItem-grow-1" >
-
- -
+ + +
-
- -
+ + +
diff --git a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx b/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx index 174496f1f3d211..f3fdb0b8009be2 100644 --- a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx @@ -74,13 +74,13 @@ describe('when using EffectedPolicySelect component', () => { const selectGlobalPolicy = () => { act(() => { - fireEvent.click(renderResult.getByTestId('globalPolicy')); + fireEvent.click(renderResult.getByTestId('test-global')); }); }; const selectPerPolicy = () => { act(() => { - fireEvent.click(renderResult.getByTestId('perPolicy')); + fireEvent.click(renderResult.getByTestId('test-perPolicy')); }); }; @@ -142,7 +142,8 @@ describe('when using EffectedPolicySelect component', () => { }); it('should maintain policies selection even if global was checked, and user switched back to per policy', () => { - render(); + const { debug } = render(); + debug(undefined, 999999); selectPerPolicy(); clickOnPolicy(); diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx index e07dc6f2d081bd..c7d1c3a46d442d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx @@ -368,7 +368,7 @@ describe('blocklist form', () => { it('should default to global policy', () => { render(); - expect(screen.getByTestId('globalPolicy')).toBeEnabled(); + expect(screen.getByTestId('blocklist-form-effectedPolicies-global')).toBeEnabled(); }); it('should correctly edit policies', () => { @@ -383,7 +383,7 @@ describe('blocklist form', () => { }, ] as PolicyData[]; render(createProps({ policies })); - const byPolicyButton = screen.getByTestId('perPolicy'); + const byPolicyButton = screen.getByTestId('blocklist-form-effectedPolicies-perPolicy'); userEvent.click(byPolicyButton); expect(byPolicyButton).toBeEnabled(); @@ -408,9 +408,9 @@ describe('blocklist form', () => { }, ] as PolicyData[]; render(createProps({ policies, item: createItem({ tags: [`policy:${policies[1].id}`] }) })); - expect(screen.getByTestId('globalPolicy')).toBeEnabled(); + expect(screen.getByTestId('blocklist-form-effectedPolicies-global')).toBeEnabled(); - const byPolicyButton = screen.getByTestId('perPolicy'); + const byPolicyButton = screen.getByTestId('blocklist-form-effectedPolicies-perPolicy'); userEvent.click(byPolicyButton); expect(byPolicyButton).toBeEnabled(); userEvent.click(screen.getByText(policies[0].name)); diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx index 2870a67e7042cb..168ecc6b84a72c 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx @@ -281,7 +281,7 @@ describe('Event filter form', () => { it('should display the policy list when "per policy" is selected', async () => { render(); - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click(renderResult.getByTestId('eventFilters-form-effectedPolicies-perPolicy')); rerenderWithLatestProps(); // policy selector should show up expect( @@ -308,17 +308,21 @@ describe('Event filter form', () => { it('should have global policy by default', async () => { render(); - expect(renderResult.getByTestId('globalPolicy')).toBeChecked(); - expect(renderResult.getByTestId('perPolicy')).not.toBeChecked(); + expect(renderResult.getByTestId('eventFilters-form-effectedPolicies-global')).toHaveAttribute( + 'aria-pressed', + 'true' + ); + expect( + renderResult.getByTestId('eventFilters-form-effectedPolicies-perPolicy') + ).toHaveAttribute('aria-pressed', 'false'); }); it('should retain the previous policy selection when switching from per-policy to global', async () => { formProps.item.tags = [formProps.policies.map((p) => `policy:${p.id}`)[0]]; render(); const policyId = formProps.policies[0].id; - // move to per-policy and select the first - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click(renderResult.getByTestId('eventFilters-form-effectedPolicies-perPolicy')); userEvent.click(renderResult.getByTestId(`policy-${policyId}`)); formProps.item.tags = formProps.onChange.mock.calls[0][0].item.tags; rerender(); @@ -328,7 +332,7 @@ describe('Event filter form', () => { expect(formProps.item.tags).toEqual([`policy:${policyId}`]); // move back to global - userEvent.click(renderResult.getByTestId('globalPolicy')); + userEvent.click(renderResult.getByTestId('eventFilters-form-effectedPolicies-global')); formProps.item.tags = ['policy:all']; rerenderWithLatestProps(); expect(formProps.item.tags).toEqual(['policy:all']); @@ -337,7 +341,7 @@ describe('Event filter form', () => { ).toBeFalsy(); // move back to per-policy - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click(renderResult.getByTestId('eventFilters-form-effectedPolicies-perPolicy')); formProps.item.tags = [`policy:${policyId}`]; rerender(); // on change called with the previous policy @@ -379,13 +383,17 @@ describe('Event filter form', () => { formProps.item.tags = ['policy:id-0']; rerender(); - expect(renderResult.queryByTestId('perPolicy')).not.toBeNull(); + expect( + renderResult.queryByTestId('eventFilters-form-effectedPolicies-perPolicy') + ).not.toBeNull(); expect(renderResult.getByTestId('policy-id-0').getAttribute('aria-disabled')).toBe('true'); }); it("allows the user to set the event filter entry to 'Global' in the edit option", () => { render(); - const globalButtonInput = renderResult.getByTestId('globalPolicy') as HTMLButtonElement; + const globalButtonInput = renderResult.getByTestId( + 'eventFilters-form-effectedPolicies-global' + ) as HTMLButtonElement; userEvent.click(globalButtonInput); formProps.item.tags = ['policy:all']; rerender(); diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx index 268fa8ac3c47a9..04b94c0262fea5 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx @@ -146,7 +146,9 @@ describe('When on the host isolation exceptions entry form', () => { }); it('should show policy as selected when user clicks on it', async () => { - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click( + renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy') + ); await clickOnEffectedPolicy(renderResult, testIdPrefix); await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true); @@ -154,20 +156,26 @@ describe('When on the host isolation exceptions entry form', () => { it('should retain the previous policy selection when switching from per-policy to global', async () => { // move to per-policy and select the first - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click( + renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy') + ); await clickOnEffectedPolicy(renderResult, testIdPrefix); await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true); // move back to global - userEvent.click(renderResult.getByTestId('globalPolicy')); + userEvent.click( + renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-global') + ); expect( renderResult.queryByTestId(`${testIdPrefix}-effectedPolicies-policiesSelectable`) ).toBeFalsy(); // move back to per-policy - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click( + renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy') + ); await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true); }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx index cc0111f23c4169..df4b06ecc2b9c8 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx @@ -430,7 +430,9 @@ describe('Trusted apps form', () => { expect(renderResult.getByTestId('policy-id-0-checkbox')).toBeChecked(); }); it("allows the user to set the trusted app entry to 'Global' in the edit option", () => { - const globalButtonInput = renderResult.getByTestId('globalPolicy') as HTMLButtonElement; + const globalButtonInput = renderResult.getByTestId( + 'trustedApps-form-effectedPolicies-global' + ) as HTMLButtonElement; act(() => { fireEvent.click(globalButtonInput); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx index 8fd5dce2da0d2a..edcadfb2d391ab 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { render, screen } from '@testing-library/react'; +import { render, screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; @@ -42,7 +42,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText(field)).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('field'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue(field); }); test('it renders the expected placeholder for the current field when field is empty', () => { @@ -82,7 +83,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('is')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('is'); }); test('it renders the negated "is" operator in a humanized format when isExcluded is true', () => { @@ -102,7 +104,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('is not')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('is not'); }); test('it renders the "exists" operator in human-readable format', () => { @@ -122,7 +125,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('exists')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('exists'); }); test('it renders the negated "exists" operator in a humanized format when isExcluded is true', () => { @@ -142,7 +146,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('does not exist')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('does not exist'); }); test('it renders the "is one of" operator in human-readable format', () => { @@ -162,7 +167,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('is one of')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('is one of'); }); test('it renders the negated "is one of" operator in a humanized format when isExcluded is true', () => { @@ -182,7 +188,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('is not one of')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('is not one of'); }); test('it renders the current value when the operator is "is"', () => { @@ -244,7 +251,9 @@ describe('StatefulEditDataProvider', () => { /> ); - expect(screen.getByText('enter one or more values')).toBeInTheDocument(); + + const wrapper = screen.getByTestId('is-one-of-combobox-input'); + expect(within(wrapper).getByPlaceholderText('enter one or more values')).toBeInTheDocument(); }); test('it renders selected values when the type of value is an array and the operator is "is one of"', () => { @@ -326,8 +335,8 @@ describe('StatefulEditDataProvider', () => { ); - // EuiCombobox does not render placeholder text with placeholder tag - expect(screen.getByText('enter one or more values')).toBeInTheDocument(); + const wrapper = screen.getByTestId('is-one-of-combobox-input'); + expect(within(wrapper).getByPlaceholderText('enter one or more values')).toBeInTheDocument(); }); test('it does NOT render value when the operator is "exists"', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap index bf7c1251f52027..2f11cdf57c3a6e 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap @@ -2,15 +2,11 @@ exports[`Field Renderers #autonomousSystemRenderer it renders correctly against snapshot 1`] = ` - .c0 .euiPopover__anchor { - width: 100%; -} - -.c1 > span.euiToolTipAnchor { + .c0 > span.euiToolTipAnchor { display: block; } -.c1 > span.euiToolTipAnchor.eui-textTruncate { +.c0 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } @@ -24,29 +20,25 @@ exports[`Field Renderers #autonomousSystemRenderer it renders correctly against class="" >
-
- - Test Org - + Test Org -
+
@@ -64,29 +56,25 @@ exports[`Field Renderers #autonomousSystemRenderer it renders correctly against class="" >
-
- - 12345 - + 12345 -
+
@@ -108,15 +96,11 @@ exports[`Field Renderers #dateRenderer it renders correctly against snapshot 1`] exports[`Field Renderers #hostIdRenderer it renders correctly against snapshot 1`] = ` - .c0 .euiPopover__anchor { - width: 100%; -} - -.c1 > span.euiToolTipAnchor { + .c0 > span.euiToolTipAnchor { display: block; } -.c1 > span.euiToolTipAnchor.eui-textTruncate { +.c0 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } @@ -124,36 +108,32 @@ exports[`Field Renderers #hostIdRenderer it renders correctly against snapshot 1 class="" >
-
- - - raspberrypi - - + raspberrypi + -
+
@@ -163,15 +143,11 @@ exports[`Field Renderers #hostIdRenderer it renders correctly against snapshot 1 exports[`Field Renderers #hostNameRenderer it renders correctly against snapshot 1`] = ` - .c0 .euiPopover__anchor { - width: 100%; -} - -.c1 > span.euiToolTipAnchor { + .c0 > span.euiToolTipAnchor { display: block; } -.c1 > span.euiToolTipAnchor.eui-textTruncate { +.c0 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } @@ -179,36 +155,32 @@ exports[`Field Renderers #hostNameRenderer it renders correctly against snapshot class="" >
-
- - - raspberrypi - - + raspberrypi + -
+
@@ -218,15 +190,11 @@ exports[`Field Renderers #hostNameRenderer it renders correctly against snapshot exports[`Field Renderers #locationRenderer it renders correctly against snapshot 1`] = ` - .c0 .euiPopover__anchor { - width: 100%; -} - -.c1 > span.euiToolTipAnchor { + .c0 > span.euiToolTipAnchor { display: block; } -.c1 > span.euiToolTipAnchor.eui-textTruncate { +.c0 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } @@ -240,29 +208,25 @@ exports[`Field Renderers #locationRenderer it renders correctly against snapshot class="" >
-
- - New York - + New York -
+
@@ -276,29 +240,25 @@ exports[`Field Renderers #locationRenderer it renders correctly against snapshot class="" >
-
- - New York - + New York -
+
diff --git a/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap index 5ef25f98932c0f..76ff4c26321beb 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap @@ -69,26 +69,22 @@ exports[`Flyout rendering it renders correctly against snapshot 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+
diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap index 8ad225711b7732..919d237027815b 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap @@ -2,13 +2,13 @@ exports[`Netflow renders correctly against snapshot 1`] = ` - .c13 svg { + .c12 svg { position: relative; top: -1px; } -.c11, -.c11 * { +.c10, +.c10 * { display: inline-block; max-width: 100%; overflow: hidden; @@ -17,18 +17,14 @@ exports[`Netflow renders correctly against snapshot 1`] = ` white-space: nowrap; } -.c1 .euiPopover__anchor { - width: 100%; -} - -.c3 { +.c2 { border-radius: 2px; padding: 0 4px 0 8px; position: relative; z-index: 0 !important; } -.c3::before { +.c2::before { background-image: linear-gradient( 135deg, #535966 25%, transparent 25% ), linear-gradient( -135deg, #535966 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #535966 75% ), linear-gradient( -135deg, transparent 75%, #535966 75% ); background-position: 0 0,1px 0,1px -1px,0px 1px; background-size: 2px 2px; @@ -41,147 +37,147 @@ exports[`Netflow renders correctly against snapshot 1`] = ` width: 4px; } -.c3:hover, -.c3:hover .euiBadge, -.c3:hover .euiBadge__text { +.c2:hover, +.c2:hover .euiBadge, +.c2:hover .euiBadge__text { cursor: move; cursor: -webkit-grab; cursor: -moz-grab; cursor: grab; } -.event-column-view:hover .c3::before, -tr:hover .c3::before { +.event-column-view:hover .c2::before, +tr:hover .c2::before { background-image: linear-gradient( 135deg, #98a2b3 25%, transparent 25% ), linear-gradient( -135deg, #98a2b3 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #98a2b3 75% ), linear-gradient( -135deg, transparent 75%, #98a2b3 75% ); } -.c3:hover, -.c3:focus, -.event-column-view:hover .c3:hover, -.event-column-view:focus .c3:focus, -tr:hover .c3:hover, -tr:hover .c3:focus { +.c2:hover, +.c2:focus, +.event-column-view:hover .c2:hover, +.event-column-view:focus .c2:focus, +tr:hover .c2:hover, +tr:hover .c2:focus { background-color: #36a2ef; } -.c3:hover, -.c3:focus, -.event-column-view:hover .c3:hover, -.event-column-view:focus .c3:focus, -tr:hover .c3:hover, -tr:hover .c3:focus, -.c3:hover a, -.c3:focus a, -.event-column-view:hover .c3:hover a, -.event-column-view:focus .c3:focus a, -tr:hover .c3:hover a, -tr:hover .c3:focus a, -.c3:hover a:hover, -.c3:focus a:hover, -.event-column-view:hover .c3:hover a:hover, -.event-column-view:focus .c3:focus a:hover, -tr:hover .c3:hover a:hover, -tr:hover .c3:focus a:hover { +.c2:hover, +.c2:focus, +.event-column-view:hover .c2:hover, +.event-column-view:focus .c2:focus, +tr:hover .c2:hover, +tr:hover .c2:focus, +.c2:hover a, +.c2:focus a, +.event-column-view:hover .c2:hover a, +.event-column-view:focus .c2:focus a, +tr:hover .c2:hover a, +tr:hover .c2:focus a, +.c2:hover a:hover, +.c2:focus a:hover, +.event-column-view:hover .c2:hover a:hover, +.event-column-view:focus .c2:focus a:hover, +tr:hover .c2:hover a:hover, +tr:hover .c2:focus a:hover { color: #1d1e24; } -.c3:hover::before, -.c3:focus::before, -.event-column-view:hover .c3:hover::before, -.event-column-view:focus .c3:focus::before, -tr:hover .c3:hover::before, -tr:hover .c3:focus::before { +.c2:hover::before, +.c2:focus::before, +.event-column-view:hover .c2:hover::before, +.event-column-view:focus .c2:focus::before, +tr:hover .c2:hover::before, +tr:hover .c2:focus::before { background-image: linear-gradient( 135deg, #1d1e24 25%, transparent 25% ), linear-gradient( -135deg, #1d1e24 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #1d1e24 75% ), linear-gradient( -135deg, transparent 75%, #1d1e24 75% ); } -.c2 { +.c1 { display: inline-block; max-width: 100%; } -.c2 [data-rbd-placeholder-context-id] { +.c1 [data-rbd-placeholder-context-id] { display: none !important; } -.c4 > span.euiToolTipAnchor { +.c3 > span.euiToolTipAnchor { display: block; } -.c4 > span.euiToolTipAnchor.eui-textTruncate { +.c3 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } -.c5 { +.c4 { vertical-align: top; } -.c22 { +.c21 { margin-right: 5px; } -.c21 { +.c20 { margin-right: 5px; } -.c15 { +.c14 { position: relative; top: 1px; } -.c14 { +.c13 { margin-right: 5px; } -.c17 { +.c16 { background-color: #343741; height: 2.8px; width: 25px; } -.c20 { +.c19 { background-color: #343741; height: 2.2px; width: 25px; } -.c19 { +.c18 { margin-right: 5px; } -.c16 { +.c15 { margin: 0 2px; } -.c16 .euiToolTipAnchor { +.c15 .euiToolTipAnchor { white-space: nowrap; } -.c18 { +.c17 { margin: 0 5px; } -.c7 { +.c6 { margin-right: 3px; } -.c8 { +.c7 { margin: 0 5px; } -.c12 { +.c11 { margin: 0 3px; } -.c10 { +.c9 { font-weight: bold; margin-top: 2px; } -.c9 { +.c8 { margin-top: 3px; } -.c6 { +.c5 { margin-right: 3px; position: relative; top: -1px; @@ -216,69 +212,65 @@ tr:hover .c3:focus::before { class="" >
-
+ - - - first.last - + first.last -
+
@@ -294,69 +286,65 @@ tr:hover .c3:focus::before { class="" >
-
+ - - - rat - + rat -
+
@@ -381,63 +369,59 @@ tr:hover .c3:focus::before { class="" >
-
- -
+ - - -
- 1ms -
-
-
-
-
+ 1ms +
+ +
+
@@ -453,59 +437,55 @@ tr:hover .c3:focus::before { class="" >
-
- -
+ - - - Nov 12, 2018 @ 19:03:25.836 - -
-
-
+ Nov 12, 2018 @ 19:03:25.836 + +
+
@@ -521,59 +501,55 @@ tr:hover .c3:focus::before { class="" >
-
- -
+ - - - Nov 12, 2018 @ 19:03:25.936 - -
-
-
+ Nov 12, 2018 @ 19:03:25.936 + +
+
@@ -597,75 +573,71 @@ tr:hover .c3:focus::before { class="euiFlexGroup emotion-euiFlexGroup-responsive-none-center-center-row" >
-
+ - - - outgoing - + outgoing -
+
@@ -675,70 +647,66 @@ tr:hover .c3:focus::before {
-
- - http - + http -
+
@@ -748,63 +716,59 @@ tr:hover .c3:focus::before {
-
- -
- - 100B - -
-
+ + 100B + +
-
+
@@ -814,63 +778,59 @@ tr:hover .c3:focus::before {
-
- -
- - 3 pkts - -
-
+ + 3 pkts + +
-
+
@@ -880,70 +840,66 @@ tr:hover .c3:focus::before {
-
- - tcp - + tcp -
+
@@ -959,64 +915,60 @@ tr:hover .c3:focus::before { class="" >
-
- - we.live.in.a - + we.live.in.a -
+
@@ -1028,7 +980,7 @@ tr:hover .c3:focus::before {
Source
@@ -1079,58 +1031,54 @@ tr:hover .c3:focus::before { class="" >
-
- - - 192.168.1.2 - - + 192.168.1.2 + -
+
@@ -1149,7 +1097,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" > : @@ -1159,7 +1107,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- - North America - + North America -
+
@@ -1264,7 +1208,7 @@ tr:hover .c3:focus::before {
-
- - United States - + United States -
+
@@ -1332,7 +1272,7 @@ tr:hover .c3:focus::before {
🇺🇸 @@ -1354,51 +1294,47 @@ tr:hover .c3:focus::before { class="" >
-
- - US - + US -
+
@@ -1410,7 +1346,7 @@ tr:hover .c3:focus::before {
-
- - Georgia - + Georgia -
+
@@ -1478,7 +1410,7 @@ tr:hover .c3:focus::before {
-
- - Atlanta - + Atlanta -
+
@@ -1553,7 +1481,7 @@ tr:hover .c3:focus::before {
@@ -1576,62 +1504,58 @@ tr:hover .c3:focus::before { class="" >
-
- -
- - (60.00%) - - - 60B - -
-
+ (60.00%) +
+ + 60B + +
-
+
@@ -1644,7 +1568,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1655,57 +1579,53 @@ tr:hover .c3:focus::before { class="" >
-
- -
- - 2 pkts - -
-
+ + 2 pkts + +
-
+
@@ -1718,7 +1638,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1752,7 +1672,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1763,62 +1683,58 @@ tr:hover .c3:focus::before { class="" >
-
- -
- - (40.00%) - - - 40B - -
-
+ (40.00%) +
+ + 40B + +
-
+
@@ -1831,7 +1747,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1842,57 +1758,53 @@ tr:hover .c3:focus::before { class="" >
-
- -
- - 1 pkts - -
-
+ + 1 pkts + +
-
+
@@ -1905,7 +1817,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1934,7 +1846,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
Destination
@@ -1958,58 +1870,54 @@ tr:hover .c3:focus::before { class="" >
-
- - - 10.1.2.3 - - + 10.1.2.3 + -
+
@@ -2028,7 +1936,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" > : @@ -2038,7 +1946,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- - North America - + North America -
+
@@ -2143,7 +2047,7 @@ tr:hover .c3:focus::before {
-
- - United States - + United States -
+
@@ -2211,7 +2111,7 @@ tr:hover .c3:focus::before {
🇺🇸 @@ -2233,51 +2133,47 @@ tr:hover .c3:focus::before { class="" >
-
- - US - + US -
+
@@ -2289,7 +2185,7 @@ tr:hover .c3:focus::before {
-
- - New York - + New York -
+
@@ -2357,7 +2249,7 @@ tr:hover .c3:focus::before {
-
- - New York - + New York -
+
@@ -2451,93 +2339,89 @@ tr:hover .c3:focus::before { class="" >
@@ -2553,93 +2437,89 @@ tr:hover .c3:focus::before { class="" >
@@ -2655,93 +2535,89 @@ tr:hover .c3:focus::before { class="" >
diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/column_header.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/column_header.tsx index c10a7fd829f9f6..945c999dbe6398 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/column_header.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/column_header.tsx @@ -42,7 +42,7 @@ const ContextMenu = styled(EuiContextMenu)` `; const PopoverContainer = styled.div<{ $width: number }>` - & .euiPopover__anchor { + & .euiPopover { padding-right: 8px; width: ${({ $width }) => $width}px; } diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap index e9f09d689f0cdd..803a4f84552f29 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap @@ -16,13 +16,13 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` border-radius: 4px; } -.c15 svg { +.c14 svg { position: relative; top: -1px; } -.c13, -.c13 * { +.c12, +.c12 * { display: inline-block; max-width: 100%; overflow: hidden; @@ -31,18 +31,14 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` white-space: nowrap; } -.c3 .euiPopover__anchor { - width: 100%; -} - -.c5 { +.c4 { border-radius: 2px; padding: 0 4px 0 8px; position: relative; z-index: 0 !important; } -.c5::before { +.c4::before { background-image: linear-gradient( 135deg, #535966 25%, transparent 25% ), linear-gradient( -135deg, #535966 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #535966 75% ), linear-gradient( -135deg, transparent 75%, #535966 75% ); background-position: 0 0,1px 0,1px -1px,0px 1px; background-size: 2px 2px; @@ -55,147 +51,147 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` width: 4px; } -.c5:hover, -.c5:hover .euiBadge, -.c5:hover .euiBadge__text { +.c4:hover, +.c4:hover .euiBadge, +.c4:hover .euiBadge__text { cursor: move; cursor: -webkit-grab; cursor: -moz-grab; cursor: grab; } -.event-column-view:hover .c5::before, -tr:hover .c5::before { +.event-column-view:hover .c4::before, +tr:hover .c4::before { background-image: linear-gradient( 135deg, #98a2b3 25%, transparent 25% ), linear-gradient( -135deg, #98a2b3 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #98a2b3 75% ), linear-gradient( -135deg, transparent 75%, #98a2b3 75% ); } -.c5:hover, -.c5:focus, -.event-column-view:hover .c5:hover, -.event-column-view:focus .c5:focus, -tr:hover .c5:hover, -tr:hover .c5:focus { +.c4:hover, +.c4:focus, +.event-column-view:hover .c4:hover, +.event-column-view:focus .c4:focus, +tr:hover .c4:hover, +tr:hover .c4:focus { background-color: #36a2ef; } -.c5:hover, -.c5:focus, -.event-column-view:hover .c5:hover, -.event-column-view:focus .c5:focus, -tr:hover .c5:hover, -tr:hover .c5:focus, -.c5:hover a, -.c5:focus a, -.event-column-view:hover .c5:hover a, -.event-column-view:focus .c5:focus a, -tr:hover .c5:hover a, -tr:hover .c5:focus a, -.c5:hover a:hover, -.c5:focus a:hover, -.event-column-view:hover .c5:hover a:hover, -.event-column-view:focus .c5:focus a:hover, -tr:hover .c5:hover a:hover, -tr:hover .c5:focus a:hover { +.c4:hover, +.c4:focus, +.event-column-view:hover .c4:hover, +.event-column-view:focus .c4:focus, +tr:hover .c4:hover, +tr:hover .c4:focus, +.c4:hover a, +.c4:focus a, +.event-column-view:hover .c4:hover a, +.event-column-view:focus .c4:focus a, +tr:hover .c4:hover a, +tr:hover .c4:focus a, +.c4:hover a:hover, +.c4:focus a:hover, +.event-column-view:hover .c4:hover a:hover, +.event-column-view:focus .c4:focus a:hover, +tr:hover .c4:hover a:hover, +tr:hover .c4:focus a:hover { color: #1d1e24; } -.c5:hover::before, -.c5:focus::before, -.event-column-view:hover .c5:hover::before, -.event-column-view:focus .c5:focus::before, -tr:hover .c5:hover::before, -tr:hover .c5:focus::before { +.c4:hover::before, +.c4:focus::before, +.event-column-view:hover .c4:hover::before, +.event-column-view:focus .c4:focus::before, +tr:hover .c4:hover::before, +tr:hover .c4:focus::before { background-image: linear-gradient( 135deg, #1d1e24 25%, transparent 25% ), linear-gradient( -135deg, #1d1e24 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #1d1e24 75% ), linear-gradient( -135deg, transparent 75%, #1d1e24 75% ); } -.c4 { +.c3 { display: inline-block; max-width: 100%; } -.c4 [data-rbd-placeholder-context-id] { +.c3 [data-rbd-placeholder-context-id] { display: none !important; } -.c6 > span.euiToolTipAnchor { +.c5 > span.euiToolTipAnchor { display: block; } -.c6 > span.euiToolTipAnchor.eui-textTruncate { +.c5 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } -.c7 { +.c6 { vertical-align: top; } -.c24 { +.c23 { margin-right: 5px; } -.c23 { +.c22 { margin-right: 5px; } -.c9 { +.c8 { margin-right: 3px; } -.c10 { +.c9 { margin: 0 5px; } -.c19 { +.c18 { background-color: #343741; height: 2.8px; width: 25px; } -.c22 { +.c21 { background-color: #343741; height: 2.2px; width: 25px; } -.c21 { +.c20 { margin-right: 5px; } -.c18 { +.c17 { margin: 0 2px; } -.c18 .euiToolTipAnchor { +.c17 .euiToolTipAnchor { white-space: nowrap; } -.c20 { +.c19 { margin: 0 5px; } -.c17 { +.c16 { position: relative; top: 1px; } -.c16 { +.c15 { margin-right: 5px; } -.c14 { +.c13 { margin: 0 3px; } -.c12 { +.c11 { font-weight: bold; margin-top: 2px; } -.c11 { +.c10 { margin-top: 3px; } -.c8 { +.c7 { margin-right: 3px; position: relative; top: -1px; @@ -240,79 +236,75 @@ tr:hover .c5:focus::before { class="" >
-
+ user.name +

+ -

- user.name -

+ - - - first.last - + first.last -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -328,79 +320,75 @@ tr:hover .c5:focus::before { class="" >
-
+ process.name +

+ -

- process.name -

+ - - - rat - + rat -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -425,73 +413,69 @@ tr:hover .c5:focus::before { class="" >
-
+ event.duration +

+ -

- event.duration -

- -
+ - - -
- 1ms -
-
-
-
-

- Press enter for options, or press space to begin dragging. -

-
+ 1ms +
+ +
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -507,69 +491,65 @@ tr:hover .c5:focus::before { class="" >
-
+ event.start +

+ -

- event.start -

- -
+ - - - Nov 12, 2018 @ 19:03:25.836 - -
-
-

- Press enter for options, or press space to begin dragging. -

-
+ Nov 12, 2018 @ 19:03:25.836 + +
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -585,69 +565,65 @@ tr:hover .c5:focus::before { class="" >
-
+ event.end +

+ -

- event.end -

- -
+ - - - Nov 12, 2018 @ 19:03:25.936 - -
-
-

- Press enter for options, or press space to begin dragging. -

-
+ Nov 12, 2018 @ 19:03:25.936 + +
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -671,85 +647,81 @@ tr:hover .c5:focus::before { class="euiFlexGroup emotion-euiFlexGroup-responsive-none-center-center-row" >
-
+ network.direction +

+ -

- network.direction -

+ - - - outgoing - + outgoing -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -759,80 +731,76 @@ tr:hover .c5:focus::before {
-
+ network.protocol +

+ -

- network.protocol -

- - http - + http -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -842,73 +810,69 @@ tr:hover .c5:focus::before {
-
+ network.bytes +

+ -

- network.bytes -

- -
- - 100B - -
-
+ + 100B + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -918,73 +882,69 @@ tr:hover .c5:focus::before {
-
+ network.packets +

+ -

- network.packets -

- -
- - 3 pkts - -
-
+ + 3 pkts + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -994,80 +954,76 @@ tr:hover .c5:focus::before {
-
+ network.transport +

+ -

- network.transport -

- - tcp - + tcp -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1083,74 +1039,70 @@ tr:hover .c5:focus::before { class="" >
-
+ network.community_id +

+ -

- network.community_id -

- - we.live.in.a - + we.live.in.a -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1162,7 +1114,7 @@ tr:hover .c5:focus::before {
Source
@@ -1213,68 +1165,64 @@ tr:hover .c5:focus::before { class="" >
-
+ source.ip +

+ -

- source.ip -

- - - 192.168.1.2 - - + 192.168.1.2 + -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1293,7 +1241,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" > : @@ -1306,84 +1254,80 @@ tr:hover .c5:focus::before { class="" >
-
+ source.port +

+ -

- source.port -

- - - + External link + + + (opens in a new tab or window) + + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1405,7 +1349,7 @@ tr:hover .c5:focus::before { class="euiFlexGroup emotion-euiFlexGroup-responsive-none-flexStart-center-row" >
-
+ source.geo.continent_name +

+ -

- source.geo.continent_name -

- - North America - + North America -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1483,7 +1423,7 @@ tr:hover .c5:focus::before {
-
+ source.geo.country_name +

+ -

- source.geo.country_name -

- - United States - + United States -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1561,7 +1497,7 @@ tr:hover .c5:focus::before {
🇺🇸 @@ -1583,61 +1519,57 @@ tr:hover .c5:focus::before { class="" >
-
+ source.geo.country_iso_code +

+ -

- source.geo.country_iso_code -

- - US - + US -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1649,7 +1581,7 @@ tr:hover .c5:focus::before {
-
+ source.geo.region_name +

+ -

- source.geo.region_name -

- - Georgia - + Georgia -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1727,7 +1655,7 @@ tr:hover .c5:focus::before {
-
+ source.geo.city_name +

+ -

- source.geo.city_name -

- - Atlanta - + Atlanta -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1812,7 +1736,7 @@ tr:hover .c5:focus::before {
@@ -1835,72 +1759,68 @@ tr:hover .c5:focus::before { class="" >
-
+ source.bytes +

+ -

- source.bytes -

- -
- - (60.00%) - - - 60B - -
-
+ (60.00%) +
+ + 60B + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1913,7 +1833,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1924,67 +1844,63 @@ tr:hover .c5:focus::before { class="" >
-
+ source.packets +

+ -

- source.packets -

- -
- - 2 pkts - -
-
+ + 2 pkts + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1997,7 +1913,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -2031,7 +1947,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -2042,72 +1958,68 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.bytes +

+ -

- destination.bytes -

- -
- - (40.00%) - - - 40B - -
-
+ (40.00%) +
+ + 40B + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2120,7 +2032,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -2131,67 +2043,63 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.packets +

+ -

- destination.packets -

- -
- - 1 pkts - -
-
+ + 1 pkts + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2204,7 +2112,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -2233,7 +2141,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
Destination
@@ -2257,68 +2165,64 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.ip +

+ -

- destination.ip -

- - - 10.1.2.3 - - + 10.1.2.3 + -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2337,7 +2241,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" > : @@ -2350,84 +2254,80 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.port +

+ -

- destination.port -

- - - + External link + + + (opens in a new tab or window) + + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2449,7 +2349,7 @@ tr:hover .c5:focus::before { class="euiFlexGroup emotion-euiFlexGroup-responsive-none-flexStart-center-row" >
-
+ destination.geo.continent_name +

+ -

- destination.geo.continent_name -

- - North America - + North America -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2527,7 +2423,7 @@ tr:hover .c5:focus::before {
-
+ destination.geo.country_name +

+ -

- destination.geo.country_name -

- - United States - + United States -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2605,7 +2497,7 @@ tr:hover .c5:focus::before {
🇺🇸 @@ -2627,61 +2519,57 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.geo.country_iso_code +

+ -

- destination.geo.country_iso_code -

- - US - + US -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2693,7 +2581,7 @@ tr:hover .c5:focus::before {
-
+ destination.geo.region_name +

+ -

- destination.geo.region_name -

- - New York - + New York -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2771,7 +2655,7 @@ tr:hover .c5:focus::before {
-
+ destination.geo.city_name +

+ -

- destination.geo.city_name -

- - New York - + New York -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2875,103 +2755,99 @@ tr:hover .c5:focus::before { class="" >
-
+ tls.fingerprints.ja3.hash +

+ -

- tls.fingerprints.ja3.hash -

+ - + ja3 + + + tls.fingerprints.ja3.hash-value - ja3 + External link - - tls.fingerprints.ja3.hash-value - - External link - - - (opens in a new tab or window) - - - + (opens in a new tab or window) + + -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2987,103 +2863,99 @@ tr:hover .c5:focus::before { class="" >
@@ -3099,103 +2971,99 @@ tr:hover .c5:focus::before { class="" >
diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx index a18176e523f1b9..d7e8ae909c75f6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx @@ -133,7 +133,7 @@ const SearchTimelineSuperSelectComponent: React.FC
- + +
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.test.tsx index 12fa612ac97949..22a33248aea55a 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.test.tsx @@ -91,13 +91,15 @@ describe('TinesParamsFields renders', () => { expect(wrapper.find('[data-test-subj="tines-bodyJsonEditor"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-storySelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-storySelector"]').first().text()).toBe( - 'Select a Tines story' - ); + expect( + wrapper.find('[data-test-subj="tines-storySelector"]').first().find('input').props() + .placeholder + ).toBe('Select a Tines story'); expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').first().text()).toBe( - 'Select a story first' - ); + expect( + wrapper.find('[data-test-subj="tines-webhookSelector"]').first().find('input').props() + .placeholder + ).toBe('Select a story first'); expect(wrapper.find('[data-test-subj="tines-fallbackCallout"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-webhookUrlInput"]').exists()).toBe(false); @@ -119,13 +121,13 @@ describe('TinesParamsFields renders', () => { expect(wrapper.find('[data-test-subj="bodyAddVariableButton"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-storySelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-storySelector"]').first().text()).toBe( - 'Select a Tines story' - ); + expect( + wrapper.find('[data-test-subj="tines-storySelector"] input').first().props().placeholder + ).toBe('Select a Tines story'); expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').first().text()).toBe( - 'Select a story first' - ); + expect( + wrapper.find('[data-test-subj="tines-webhookSelector"] input').first().props().placeholder + ).toBe('Select a story first'); expect(mockEditAction).toHaveBeenCalledWith('subAction', 'test', index); }); @@ -223,9 +225,9 @@ describe('TinesParamsFields renders', () => { expect( wrapper.find('[data-test-subj="tines-webhookSelector"]').first().prop('disabled') ).toBe(false); - expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').first().text()).toBe( - 'Select a webhook action' - ); + expect( + wrapper.find('[data-test-subj="tines-webhookSelector"] input').first().props().placeholder + ).toBe('Select a webhook action'); wrapper .find( '[data-test-subj="tines-webhookSelector"] [data-test-subj="comboBoxToggleListButton"]' @@ -312,13 +314,13 @@ describe('TinesParamsFields renders', () => { expect(wrapper.find('[data-test-subj="tines-bodyJsonEditor"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-storySelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-storySelector"]').first().text()).toBe( - story.name - ); + expect( + wrapper.find('[data-test-subj="tines-storySelector"] input').first().props().value + ).toBe(story.name); expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').first().text()).toBe( - webhook.name - ); + expect( + wrapper.find('[data-test-subj="tines-webhookSelector"] input').first().props().value + ).toBe(webhook.name); expect(wrapper.find('[data-test-subj="tines-fallbackCallout"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-webhookUrlInput"]').exists()).toBe(false); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx index 4f961f8a7bf6c1..e3bf983d7bd096 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx @@ -123,6 +123,6 @@ describe('connectors_selection', () => { ); - expect(screen.queryAllByText('test pagerduty')).toHaveLength(1); + expect(screen.getByRole('combobox')).toHaveValue('test pagerduty'); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_consumer_selection.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_consumer_selection.test.tsx index 52a2ac09140886..324e9a290e8316 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_consumer_selection.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_consumer_selection.test.tsx @@ -30,7 +30,11 @@ describe('RuleFormConsumerSelectionModal', () => { ); expect(screen.getByTestId('ruleFormConsumerSelect')).toBeInTheDocument(); - expect(screen.getByText('Select a scope')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveAttribute( + 'placeholder', + 'Select a scope' + ); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue(''); fireEvent.click(screen.getByTestId('comboBoxToggleListButton')); expect(screen.getByText('Logs')).toBeInTheDocument(); expect(screen.getByText('Metrics')).toBeInTheDocument(); @@ -116,8 +120,7 @@ describe('RuleFormConsumerSelectionModal', () => { /> ); - expect(screen.getByText('Logs')).toBeInTheDocument(); - expect(() => screen.getByText('Select a scope')).toThrow(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue('Logs'); }); it('should not display the initial selected consumer if it is not a selectable option', () => { @@ -129,7 +132,6 @@ describe('RuleFormConsumerSelectionModal', () => { errors={{}} /> ); - expect(() => screen.getByText('Logs')).toThrow(); - expect(screen.getByText('Select a scope')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue(''); }); }); diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap b/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap index b85193cb80f05f..5b8d20ae63ba02 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap @@ -2,33 +2,29 @@ exports[`ML Integrations renders without errors 1`] = `
-
- -
+ aria-label="Loading" + class="euiLoadingSpinner emotion-euiLoadingSpinner-m" + role="progressbar" + style="border-color:#07C currentcolor currentcolor currentcolor" + /> + + +
`; diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap index 77345c95164a6d..8a4e0915d4fa3c 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap @@ -83,42 +83,38 @@ Array [ Enable status alerts
-
- -
+ class="euiSwitch__thumb" + /> + + +
diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap index 527247ec9f0727..8e559f70cd5fb9 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap @@ -2,30 +2,26 @@ exports[`DownNoExpressionSelect component should renders against props 1`] = `
-
- - matching monitors are down >= - - - - 5 times - + matching monitors are down >= -
+ + + 5 times + +
`; diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap index 8bdfe9e9b28eb5..49aabf62728c14 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap @@ -8,58 +8,50 @@ exports[`TimeExpressionSelect component should renders against props 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- - within - - - - last 15 - + within -
+ + + last 15 + +
-
+ + - - - - minutes - + minutes -
+
diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts index 99985787c53a0c..56a4ad07285f58 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts @@ -18,6 +18,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { ]); const testSubjects = getService('testSubjects'); + const comboBox = getService('comboBox'); describe('Table', function describeIndexTests() { const isNewChartsLibraryEnabled = true; @@ -85,8 +86,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(await dimensions[0].getVisibleText()).to.be('Average machine.ram'); await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger'); - const summaryRowFunction = await testSubjects.find('lnsDatatable_summaryrow_function'); - expect(await summaryRowFunction.getVisibleText()).to.be('Sum'); + expect(await comboBox.getComboBoxSelectedOptions('lnsDatatable_summaryrow_function')).to.eql([ + 'Sum', + ]); }); it('should convert sibling pipeline aggregation', async () => { @@ -171,8 +173,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const percentageColumnText = await lens.getDimensionTriggerText('lnsDatatable_metrics', 1); await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger', 0, 1); - const format = await testSubjects.find('indexPattern-dimension-format'); - expect(await format.getVisibleText()).to.be('Percent'); + expect(await comboBox.getComboBoxSelectedOptions('indexPattern-dimension-format')).to.eql([ + 'Percent', + ]); const dimensions = await testSubjects.findAll('lns-dimensionTrigger'); expect(dimensions).to.have.length(2); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts index d2f8b49c1ae92e..9e9f301859db5c 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts @@ -114,8 +114,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await lens.waitForVisualization('lnsDataTable'); await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger'); await testSubjects.click('indexPattern-advanced-accordion'); - const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); - expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + const reducedTimeRange = await testSubjects.find( + 'indexPattern-dimension-reducedTimeRange > comboBoxSearchInput' + ); + expect(await reducedTimeRange.getAttribute('value')).to.be('1 minute (1m)'); await retry.try(async () => { const layerCount = await lens.getLayerCount(); expect(layerCount).to.be(1); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts index 10b8e2136deb15..5207b18035837c 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts @@ -115,8 +115,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await lens.waitForVisualization('xyVisChart'); await lens.openDimensionEditor('lnsXY_yDimensionPanel > lns-dimensionTrigger'); await testSubjects.click('indexPattern-advanced-accordion'); - const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); - expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + const reducedTimeRange = await testSubjects.find( + 'indexPattern-dimension-reducedTimeRange > comboBoxSearchInput' + ); + expect(await reducedTimeRange.getAttribute('value')).to.be('1 minute (1m)'); await retry.try(async () => { const layerCount = await lens.getLayerCount(); expect(layerCount).to.be(1); diff --git a/x-pack/test/functional/apps/maps/group4/layer_errors.js b/x-pack/test/functional/apps/maps/group4/layer_errors.js index e597f1bb0fe521..e47c0e582c8f49 100644 --- a/x-pack/test/functional/apps/maps/group4/layer_errors.js +++ b/x-pack/test/functional/apps/maps/group4/layer_errors.js @@ -11,6 +11,7 @@ export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['maps', 'header']); const inspector = getService('inspector'); const testSubjects = getService('testSubjects'); + const comboBox = getService('comboBox'); describe('layer errors', () => { before(async () => { @@ -33,8 +34,9 @@ export default function ({ getPageObjects, getService }) { it('should open request in inspector', async () => { await testSubjects.click('viewEsErrorButton'); - const selectedRequest = await testSubjects.getVisibleText('euiComboBoxPill'); - expect(selectedRequest).to.equal('load layer features (connections)'); + expect(await comboBox.getComboBoxSelectedOptions('inspectorRequestChooser')).to.eql([ + 'load layer features (connections)', + ]); }); }); diff --git a/x-pack/test/functional/page_objects/infra_home_page.ts b/x-pack/test/functional/page_objects/infra_home_page.ts index a867535ea06ee0..0247ecde88ac91 100644 --- a/x-pack/test/functional/page_objects/infra_home_page.ts +++ b/x-pack/test/functional/page_objects/infra_home_page.ts @@ -337,7 +337,7 @@ export function InfraHomePageProvider({ getService, getPageObjects }: FtrProvide await testSubjects.click('superDatePickerAbsoluteTab'); const datePickerInput = await testSubjects.find('superDatePickerAbsoluteDateInput'); await datePickerInput.clearValueWithKeyboard(); - await datePickerInput.type([date]); + await datePickerInput.type([date, browser.keys.RETURN]); }, async setAnomaliesThreshold(threshold: string) { const thresholdInput = await find.byCssSelector( diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index d0c962d8c574a5..429b30b6864854 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -912,8 +912,8 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont `[data-test-subj^="lnsXY_axisSide_groups_"]` ); for (const axisSideGroup of axisSideGroups) { - const input = await axisSideGroup.findByTagName('input'); - const isSelected = await input.isSelected(); + const ariaPressed = await axisSideGroup.getAttribute('aria-pressed'); + const isSelected = ariaPressed === 'true'; if (isSelected) { return axisSideGroup?.getVisibleText(); } @@ -1439,7 +1439,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont */ async assertFocusedField(name: string) { const input = await find.activeElement(); - const fieldAncestor = await input.findByXpath('./../../..'); + const fieldAncestor = await input.findByXpath('./../..'); const focusedElementText = await fieldAncestor.getVisibleText(); const dataTestSubj = await fieldAncestor.getAttribute('data-test-subj'); expect(focusedElementText).to.eql(name); diff --git a/x-pack/test/functional/services/ml/stack_management_jobs.ts b/x-pack/test/functional/services/ml/stack_management_jobs.ts index e99172b374f9d3..f8db28deb50928 100644 --- a/x-pack/test/functional/services/ml/stack_management_jobs.ts +++ b/x-pack/test/functional/services/ml/stack_management_jobs.ts @@ -142,27 +142,22 @@ export function MachineLearningStackManagementJobsProvider({ await testSubjects.missingOrFail('share-to-space-flyout', { timeout: 2000 }); }, - async selectShareToSpacesMode(inputTestSubj: 'shareToExplicitSpacesId' | 'shareToAllSpacesId') { - // The input element can not be clicked directly. - // Instead, we need to click the parent label - const getInputLabel = async () => { - const input = await testSubjects.find(inputTestSubj, 1000); - return await input.findByXpath('./../../..'); // Clicks the parent label 3 levels up - }; + async selectShareToSpacesMode( + buttonTestSubj: 'shareToExplicitSpacesId' | 'shareToAllSpacesId' + ) { await retry.tryForTime(5000, async () => { - const labelElement = await getInputLabel(); - await labelElement.click(); + const button = await testSubjects.find(buttonTestSubj, 1000); + await button.click(); - const checked = await testSubjects.getAttribute(inputTestSubj, 'checked', 1000); - expect(checked).to.eql('true', `Input '${inputTestSubj}' should be checked`); + const isPressed = await button.getAttribute('aria-pressed'); + expect(isPressed).to.eql('true', `Button '${buttonTestSubj}' should be checked`); - // sometimes the checked attribute of the input is set but it's not actually + // sometimes the aria-pressed attribute of the button is set but it's not actually // selected, so we're also checking the class of the corresponding label - const updatedLabelElement = await getInputLabel(); - const labelClasses = await updatedLabelElement.getAttribute('class'); + const labelClasses = await button.getAttribute('class'); expect(labelClasses).to.contain( 'euiButtonGroupButton-isSelected', - `Label for '${inputTestSubj}' should be selected` + `Label for '${buttonTestSubj}' should be selected` ); }); }, diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts index 8d5b537dd3bceb..eef28b77e7ac58 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts @@ -195,8 +195,8 @@ describe('Add endpoint exception from rule details', { tags: ['@ess', '@serverle .eq(0) .find(FIELD_INPUT_PARENT) .eq(0) - .should('have.text', ITEM_FIELD); - cy.get(VALUES_INPUT).should('have.text', 'foo'); + .should('have.value', ITEM_FIELD); + cy.get(VALUES_INPUT).should('have.value', 'foo'); // edit conditions editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception.cy.ts index 70c35610476b8a..b1115b5833bd05 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception.cy.ts @@ -149,7 +149,7 @@ describe( .eq(0) .find(FIELD_INPUT_PARENT) .eq(0) - .should('have.text', ITEM_FIELD); + .should('have.value', ITEM_FIELD); cy.get(VALUES_MATCH_ANY_INPUT).should('have.text', 'foo'); // edit conditions diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts index 3f585dbad90cf4..18c75ce25cbfa8 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts @@ -165,8 +165,8 @@ describe( .eq(0) .find(FIELD_INPUT_PARENT) .eq(0) - .should('have.text', ITEM_FIELD); - cy.get(VALUES_INPUT).should('have.text', 'foo'); + .should('have.value', ITEM_FIELD); + cy.get(VALUES_INPUT).should('have.value', 'foo'); // edit conditions editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts index 5b0fc1f1229287..b2b000803e6c47 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts @@ -287,10 +287,9 @@ describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless }); getIndicatorDeleteButton().click(); getIndicatorIndexComboField().find('input').should('have.value', 'agent.name'); - getIndicatorMappingComboField().should( - 'have.text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].value - ); + getIndicatorMappingComboField() + .find('input') + .should('have.value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].value); getIndicatorIndexComboField(2).should('not.exist'); getIndicatorMappingComboField(2).should('not.exist'); }); @@ -343,8 +342,14 @@ describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless indicatorIndexField: getNewThreatIndicatorRule().threat_mapping[0].entries[0].value, }); getIndicatorDeleteButton().click(); - getIndicatorIndexComboField().should('text', 'Search'); - getIndicatorMappingComboField().should('text', 'Search'); + getIndicatorIndexComboField() + .find('input') + .should('value', '') + .should('have.attr', 'placeholder', 'Search'); + getIndicatorMappingComboField() + .find('input') + .should('value', '') + .should('have.attr', 'placeholder', 'Search'); getIndicatorIndexComboField(2).should('not.exist'); getIndicatorMappingComboField(2).should('not.exist'); }); @@ -368,22 +373,18 @@ describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless indicatorIndexField: getNewThreatIndicatorRule().threat_mapping[0].entries[0].value, }); getIndicatorDeleteButton(2).click(); - getIndicatorIndexComboField(1).should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].field - ); - getIndicatorMappingComboField(1).should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].value - ); - getIndicatorIndexComboField(2).should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].field - ); - getIndicatorMappingComboField(2).should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].value - ); + getIndicatorIndexComboField(1) + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].field); + getIndicatorMappingComboField(1) + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].value); + getIndicatorIndexComboField(2) + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].field); + getIndicatorMappingComboField(2) + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].value); getIndicatorIndexComboField(3).should('not.exist'); getIndicatorMappingComboField(3).should('not.exist'); }); @@ -401,14 +402,12 @@ describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless indicatorIndexField: getNewThreatIndicatorRule().threat_mapping[0].entries[0].value, }); getIndicatorDeleteButton().click(); - getIndicatorIndexComboField().should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].field - ); - getIndicatorMappingComboField().should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].value - ); + getIndicatorIndexComboField() + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].field); + getIndicatorMappingComboField() + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].value); getIndicatorIndexComboField(2).should('not.exist'); getIndicatorMappingComboField(2).should('not.exist'); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts index 80d4a9780c6e75..4867ba79183f3f 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts @@ -116,7 +116,7 @@ describe('Row renderers', { tags: ['@ess', '@serverless'] }, () => { // A follw-up ticket to tackle this issue has been created. it.skip('Signature tooltips do not overlap', () => { // Hover the signature to show the tooltips - cy.get(TIMELINE_ROW_RENDERERS_SURICATA_SIGNATURE).parents('.euiPopover__anchor').realHover(); + cy.get(TIMELINE_ROW_RENDERERS_SURICATA_SIGNATURE).parents('.euiPopover').realHover(); cy.get(TIMELINE_ROW_RENDERERS_SURICATA_LINK_TOOLTIP).then(($googleLinkTooltip) => { cy.get(TIMELINE_ROW_RENDERERS_SURICATA_SIGNATURE_TOOLTIP).then(($signatureTooltip) => { diff --git a/x-pack/test/security_solution_cypress/cypress/screens/exceptions.ts b/x-pack/test/security_solution_cypress/cypress/screens/exceptions.ts index f93e01271fda9f..b4032167ebe431 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/exceptions.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/exceptions.ts @@ -12,19 +12,20 @@ export const CLOSE_SINGLE_ALERT_CHECKBOX = '[data-test-subj="closeAlertOnAddExce export const CONFIRM_BTN = '[data-test-subj="addExceptionConfirmButton"]'; export const FIELD_INPUT = - '[data-test-subj="fieldAutocompleteComboBox"] [data-test-subj="comboBoxInput"] input'; + '[data-test-subj="fieldAutocompleteComboBox"] [data-test-subj="comboBoxSearchInput"]'; export const FIELD_INPUT_PARENT = - '[data-test-subj="fieldAutocompleteComboBox"] [data-test-subj="comboBoxInput"]'; + '[data-test-subj="fieldAutocompleteComboBox"] [data-test-subj="comboBoxSearchInput"]'; export const LOADING_SPINNER = '[data-test-subj="loading-spinner"]'; export const EXCEPTION_FLYOUT_LOADING_SPINNER = '[data-test-subj="loadingAddExceptionFlyout"]'; -export const OPERATOR_INPUT = '[data-test-subj="operatorAutocompleteComboBox"]'; +export const OPERATOR_INPUT = + '[data-test-subj="operatorAutocompleteComboBox"] [data-test-subj="comboBoxInput"]'; export const VALUES_INPUT = - '[data-test-subj="valuesAutocompleteMatch"] [data-test-subj="comboBoxInput"]'; + '[data-test-subj="valuesAutocompleteMatch"] [data-test-subj="comboBoxSearchInput"]'; export const VALUES_MATCH_ANY_INPUT = '[data-test-subj="valuesAutocompleteMatchAny"] [data-test-subj="comboBoxInput"]'; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts b/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts index 00d5a892593b6e..99823f357dc90d 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts @@ -76,7 +76,7 @@ export const updateDateRangeInLocalDatePickers = ( cy.get(DATE_PICKER_ABSOLUTE_INPUT).click(); cy.get(DATE_PICKER_ABSOLUTE_INPUT).clear(); - cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(startDate); + cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(`${startDate}{enter}`); cy.get(GET_LOCAL_DATE_PICKER_APPLY_BUTTON(localQueryBarSelector)).click(); cy.get(GET_LOCAL_DATE_PICKER_APPLY_BUTTON(localQueryBarSelector)).should( 'not.have.text', @@ -89,7 +89,7 @@ export const updateDateRangeInLocalDatePickers = ( cy.get(DATE_PICKER_ABSOLUTE_INPUT).click(); cy.get(DATE_PICKER_ABSOLUTE_INPUT).clear(); - cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(endDate); + cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(`${endDate}{enter}`); cy.get(GET_LOCAL_DATE_PICKER_APPLY_BUTTON(localQueryBarSelector)).click(); }; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts b/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts index 4ed5ff5ef2f8da..db260fab5ad6bd 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts @@ -74,7 +74,7 @@ export const addExceptionEntryFieldValueOfItemX = ( .eq(itemIndex) .find(FIELD_INPUT) .eq(fieldIndex) - .type(`${field}{enter}`); + .type(`{selectall}${field}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; @@ -99,7 +99,7 @@ export const selectCurrentEntryField = (index = 0) => { }; export const addExceptionEntryFieldValue = (field: string, index = 0) => { - cy.get(FIELD_INPUT).eq(index).type(`${field}{enter}`); + cy.get(FIELD_INPUT).eq(index).type(`{selectall}${field}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; @@ -109,23 +109,23 @@ export const addExceptionEntryFieldValueAndSelectSuggestion = (field: string, in }; export const addExceptionEntryOperatorValue = (operator: string, index = 0) => { - cy.get(OPERATOR_INPUT).eq(index).type(`${operator}{enter}`); + cy.get(OPERATOR_INPUT).eq(index).type(`{selectall}${operator}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; export const addExceptionEntryFieldValueValue = (value: string, index = 0) => { - cy.get(VALUES_INPUT).eq(index).type(`${value}{enter}`); + cy.get(VALUES_INPUT).eq(index).type(`{selectall}${value}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; export const addExceptionEntryFieldMatchAnyValue = (values: string[], index = 0) => { values.forEach((value) => { - cy.get(VALUES_MATCH_ANY_INPUT).eq(index).type(`${value}{enter}`); + cy.get(VALUES_MATCH_ANY_INPUT).eq(index).type(`{selectall}${value}{enter}`); }); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; export const addExceptionEntryFieldMatchIncludedValue = (value: string, index = 0) => { - cy.get(VALUES_MATCH_INCLUDED_INPUT).eq(index).type(`${value}{enter}`); + cy.get(VALUES_MATCH_INCLUDED_INPUT).eq(index).type(`{selectall}${value}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; @@ -148,13 +148,13 @@ export const addExceptionFlyoutItemName = (name: string) => { cy.get(EXCEPTION_ITEM_NAME_INPUT).scrollIntoView(); cy.get(EXCEPTION_ITEM_NAME_INPUT).should('be.visible'); cy.get(EXCEPTION_ITEM_NAME_INPUT).first().focus(); - cy.get(EXCEPTION_ITEM_NAME_INPUT).type(`${name}{enter}`, { force: true }); + cy.get(EXCEPTION_ITEM_NAME_INPUT).type(`{selectall}${name}{enter}`, { force: true }); cy.get(EXCEPTION_ITEM_NAME_INPUT).should('have.value', name); }; export const editExceptionFlyoutItemName = (name: string) => { cy.get(EXCEPTION_ITEM_NAME_INPUT).clear(); - cy.get(EXCEPTION_ITEM_NAME_INPUT).type(`${name}{enter}`); + cy.get(EXCEPTION_ITEM_NAME_INPUT).type(`{selectall}${name}{enter}`); cy.get(EXCEPTION_ITEM_NAME_INPUT).should('have.value', name); }; @@ -169,12 +169,12 @@ export const selectCloseSingleAlerts = () => { export const addExceptionConditions = (exception: Exception) => { cy.get(FIELD_INPUT).type(`${exception.field}{downArrow}{enter}`); - cy.get(OPERATOR_INPUT).type(`${exception.operator}{enter}`); + cy.get(OPERATOR_INPUT).type(`{selectall}${exception.operator}{enter}`); if (exception.operator === 'is one of') { addExceptionEntryFieldMatchAnyValue(exception.values, 0); } else { exception.values.forEach((value) => { - cy.get(VALUES_INPUT).type(`${value}{enter}`); + cy.get(VALUES_INPUT).type(`{selectall}${value}{enter}`); }); } }; @@ -189,7 +189,7 @@ export const submitNewExceptionItem = () => { cy.get(CONFIRM_BTN).should('exist'); /* Sometimes a toaster error message unrelated with the test performed is displayed. The toaster is blocking the confirm button we have to click. Using force true would solve the issue, but should not be used. - There are some tests that use the closeErrorToast() method to close error toasters before continuing with the interactions with the page. + There are some tests that use the closeErrorToast() method to close error toasters before continuing with the interactions with the page. In this case we check if a toaster is displayed and if so, close it to continue with the test. */ cy.root().then(($page) => { diff --git a/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts b/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts index aab49b3c5c2996..539101c795047c 100644 --- a/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts +++ b/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts @@ -26,6 +26,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const supertest = getService('supertest'); const find = getService('find'); const unzipPromisify = promisify(unzip); + const comboBox = getService('comboBox'); // FLAKY: https://github.com/elastic/kibana/issues/173184 describe.skip('Endpoint Exceptions', function () { @@ -60,7 +61,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const setLastFieldsValue = async ({ testSubj, value, - optionSelector = `button[title="${value}"]`, }: { testSubj: string; value: string; @@ -71,11 +71,16 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const lastField = fields[fields.length - 1]; await lastField.click(); - const inputField = await lastField.findByTagName('input'); - await inputField.type(value); - - const dropdownOptionSelector = `[data-test-subj="comboBoxOptionsList ${testSubj}-optionsList"] ${optionSelector}`; - await find.clickByCssSelector(dropdownOptionSelector); + await retry.try( + async () => { + await comboBox.setElement(lastField, value); + }, + async () => { + // If the above fails due to an option not existing, create the value custom instead + await comboBox.setFilterValue(lastField, value); + await pageObjects.common.pressEnterKey(); + } + ); }; const setLastEntry = async ({ @@ -92,7 +97,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await setLastFieldsValue({ testSubj: operator === 'matches' ? 'valuesAutocompleteWildcard' : 'valuesAutocompleteMatch', value, - optionSelector: 'p', }); }; diff --git a/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/table.ts b/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/table.ts index be48300683d7c1..864e205e3ff5f5 100644 --- a/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/table.ts +++ b/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/table.ts @@ -22,6 +22,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const retry = getService('retry'); const panelActions = getService('dashboardPanelActions'); const kibanaServer = getService('kibanaServer'); + const comboBox = getService('comboBox'); describe('Table', function describeIndexTests() { const fixture = @@ -83,8 +84,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger'); await testSubjects.click('indexPattern-advanced-accordion'); - const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); - expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + expect( + await comboBox.getComboBoxSelectedOptions('indexPattern-dimension-reducedTimeRange') + ).to.eql(['1 minute (1m)']); + await retry.try(async () => { const layerCount = await lens.getLayerCount(); expect(layerCount).to.be(1); diff --git a/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/top_n.ts b/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/top_n.ts index dd7fdb01827ddd..4085e7faad08c4 100644 --- a/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/top_n.ts +++ b/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/top_n.ts @@ -17,6 +17,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const queryBar = getService('queryBar'); const panelActions = getService('dashboardPanelActions'); const kibanaServer = getService('kibanaServer'); + const comboBox = getService('comboBox'); describe('Top N', function describeIndexTests() { const fixture = @@ -102,7 +103,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await lens.openDimensionEditor('lnsXY_yDimensionPanel > lns-dimensionTrigger'); await testSubjects.click('indexPattern-advanced-accordion'); const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); - expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + await comboBox.isOptionSelected(reducedTimeRange, '1 minute (1m)'); await retry.try(async () => { const layerCount = await lens.getLayerCount(); expect(layerCount).to.be(1); diff --git a/yarn.lock b/yarn.lock index b5c49b37d930ac..2b01aaf7c3a7e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1625,10 +1625,10 @@ resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314" integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ== -"@elastic/eui@90.0.1-backport.0": - version "90.0.1-backport.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-90.0.1-backport.0.tgz#c57910220dab4f85c813c4b7b44a80500b5abf82" - integrity sha512-mv8ucgZdBAJ7i7sDb6K1wHS9eboVe4rb3Vg0NSIMsat2skCfQAods+aPuXuKo323W57uZGnJnQlO07wF4iA3Tg== +"@elastic/eui@91.0.0-backport.0": + version "91.0.0-backport.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-91.0.0-backport.0.tgz#821306a580cc8fcf1a142106e425f3fcd1bebfbf" + integrity sha512-2T+8JiPs1Ejh2T8l7cwqv/IIlNV6I9RbXtJ60L9U4lJGtS/R8zIoikrR/2SEs8bXwyXXg4i/trhfbYbylAvZpw== dependencies: "@hello-pangea/dnd" "^16.3.0" "@types/lodash" "^4.14.198"