From 8ebeede37194edd14b37c6e1da6a92691646f4a7 Mon Sep 17 00:00:00 2001 From: dej611 Date: Tue, 8 Jun 2021 10:27:05 +0200 Subject: [PATCH] :white_check_mark: Fix unit tests + restore right data-test-id --- .../components/dimension_editor.test.tsx | 14 +++++++------- .../components/dimension_editor.tsx | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.test.tsx index 220e4e1fde3f8..ede8b026248f0 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { EuiButtonGroup, EuiFieldText, EuiSuperSelect } from '@elastic/eui'; +import { EuiButtonGroup, EuiComboBox, EuiFieldText, EuiSuperSelect } from '@elastic/eui'; import { FramePublicAPI, VisualizationDimensionEditorProps } from '../../types'; import { DatatableVisualizationState } from '../visualization'; import { createMockDatasource, createMockFramePublicAPI } from '../../editor_frame_service/mocks'; @@ -227,9 +227,9 @@ describe('data table dimension editor', () => { expect( instance .find('[data-test-subj="lnsDatatable_summaryrow_function"]') - .find(EuiSuperSelect) - .prop('valueOfSelected') - ).toEqual('none'); + .find(EuiComboBox) + .prop('selectedOptions') + ).toEqual([{ value: 'none', label: 'None' }]); expect(instance.find('[data-test-subj="lnsDatatable_summaryrow_label"]').exists()).toBe(false); }); @@ -241,9 +241,9 @@ describe('data table dimension editor', () => { expect( instance .find('[data-test-subj="lnsDatatable_summaryrow_function"]') - .find(EuiSuperSelect) - .prop('valueOfSelected') - ).toEqual('sum'); + .find(EuiComboBox) + .prop('selectedOptions') + ).toEqual([{ value: 'sum', label: 'Sum' }]); expect( instance diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.tsx index f09af0f18088b..2142583a13c49 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.tsx @@ -215,7 +215,7 @@ export function TableDimensionEditor( fullWidth compressed isClearable={false} - data-test-subj="indexPattern-dimension-field" + data-test-subj="lnsDatatable_summaryrow_function" placeholder={i18n.translate('xpack.lens.indexPattern.fieldPlaceholder', { defaultMessage: 'Field', })}