Skip to content

Commit

Permalink
create general fieldlist component handling arbitrary number of accor…
Browse files Browse the repository at this point in the history
…dions
  • Loading branch information
flash1293 committed Sep 16, 2020
1 parent 4772717 commit 1592748
Show file tree
Hide file tree
Showing 3 changed files with 250 additions and 900 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,35 @@ describe('IndexPattern Data Panel', () => {
).toEqual(['client', 'source', 'timestampLabel']);
});

it('should show meta fields accordion', async () => {
const wrapper = mountWithIntl(
<InnerIndexPatternDataPanel
{...props}
indexPatterns={{
'1': {
...props.indexPatterns['1'],
fields: [
...props.indexPatterns['1'].fields,
{ name: '_id', displayName: '_id', meta: true, type: 'string' },
],
},
}}
/>
);
wrapper
.find('[data-test-subj="lnsIndexPatternMetaFields"]')
.find('button')
.first()
.simulate('click');
expect(
wrapper
.find('[data-test-subj="lnsIndexPatternMetaFields"]')
.find(FieldItem)
.first()
.prop('field').name
).toEqual('_id');
});

it('should display NoFieldsCallout when all fields are empty', async () => {
const wrapper = mountWithIntl(
<InnerIndexPatternDataPanel {...defaultProps} existingFields={{ idx1: {} }} />
Expand Down
Loading

0 comments on commit 1592748

Please sign in to comment.