Skip to content

Commit

Permalink
[7.16] [data views] data view management - provide detail modal for c…
Browse files Browse the repository at this point in the history
…onflicted fields (#118286) (#119513)

* [data views] data view management - provide detail modal for conflicted fields (#118286)

* provide modal for conflicted fields

# Conflicts:
#	src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/__snapshots__/table.test.tsx.snap
#	src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx
#	src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx

* update snapshot
  • Loading branch information
mattkime authored Nov 23, 2021
1 parent b6cd37c commit 8b022c6
Show file tree
Hide file tree
Showing 8 changed files with 297 additions and 51 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import React from 'react';
import { shallow } from 'enzyme';
import { IndexPattern } from 'src/plugins/data/public';
import { IndexedFieldItem } from '../../types';
import { Table, renderFieldName } from './table';
import { Table, renderFieldName, getConflictModalContent } from './table';
import { overlayServiceMock } from 'src/core/public/mocks';

const indexPattern = {
timeFieldName: 'timestamp',
Expand Down Expand Up @@ -43,6 +44,7 @@ const items: IndexedFieldItem[] = [
{
name: 'conflictingField',
displayName: 'conflictingField',
conflictDescriptions: { keyword: ['index_a'], long: ['index_b'] },
type: 'text, long',
kbnType: 'conflict',
info: [],
Expand Down Expand Up @@ -81,7 +83,13 @@ const renderTable = (
}
) =>
shallow(
<Table indexPattern={indexPattern} items={items} editField={editField} deleteField={() => {}} />
<Table
indexPattern={indexPattern}
items={items}
editField={editField}
deleteField={() => {}}
openModal={overlayServiceMock.createStartContract().openModal}
/>
);

describe('Table', () => {
Expand Down Expand Up @@ -116,7 +124,12 @@ describe('Table', () => {

test('should render conflicting type', () => {
const tableCell = shallow(
renderTable().prop('columns')[1].render('conflict', { kbnType: 'conflict' })
renderTable()
.prop('columns')[1]
.render('conflict', {
kbnType: 'conflict',
conflictDescriptions: { keyword: ['index_a'], long: ['index_b'] },
})
);
expect(tableCell).toMatchSnapshot();
});
Expand Down Expand Up @@ -163,4 +176,14 @@ describe('Table', () => {

expect(renderFieldName(runtimeField)).toMatchSnapshot();
});

test('render conflict summary modal ', () => {
expect(
getConflictModalContent({
closeFn: () => {},
fieldName: 'message',
conflictDescriptions: { keyword: ['index_a'], long: ['index_b'] },
})
).toMatchSnapshot();
});
});
Loading

0 comments on commit 8b022c6

Please sign in to comment.