Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rollup] Unit test for detail panel #31690

Merged
merged 12 commits into from
Feb 26, 2019
2 changes: 1 addition & 1 deletion x-pack/plugins/rollup/__jest__/utils/testbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Provider } from 'react-redux';
import { mountWithIntl } from 'test_utils/enzyme_helpers'; // eslint-disable-line import/no-unresolved
import { findTestSubject as findTestSubjectHelper } from '@elastic/eui/lib/test';

const registerTestSubjExists = component => testSubject => Boolean(findTestSubjectHelper(component, testSubject).length);
const registerTestSubjExists = component => (testSubject, count = 1) => findTestSubjectHelper(component, testSubject).length === count;

export const registerTestBed = (Component, defaultProps, store = {}) => (props) => {
const component = mountWithIntl(
Expand Down
14 changes: 9 additions & 5 deletions x-pack/plugins/rollup/fixtures/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,38 @@ const initialValues = {
dateHistogramField: 'timestamp',
dateHistogramInterval: '24h',
dateHistogramTimeZone: 'UTC',
documentsProcessed: 0,
documentsProcessed: 10,
histogram: [
{ name: 'DistanceMiles' },
{ name: 'FlightTimeMin' },
],
id: 'test',
indexPattern: 'kibana*',
json: {
foo: 'bar',
},
metrics: [
{
name: 'dayOfWeek',
types: ['avg', 'min']
types: ['avg', 'max', 'min']
},
{
name: 'distanceKilometers',
types: ['avg', 'max']
}
],
pagesProcessed: 0,
pagesProcessed: 3,
rollupCron: '0 0 0 ? * 7',
rollupDelay: '1d',
rollupIndex: 'my_rollup_index',
rollupsIndexed: 0,
rollupsIndexed: 2,
status: 'stopped',
terms: [
{ name: 'Dest' },
{ name: 'Carrier' },
{ name: 'DestCountry' },
],
triggerCount: 0,
triggerCount: 7,
};

export const getJob = (values = { id: getRandomString() }) => ({ ...initialValues, ...values });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { Fragment } from 'react';
import React from 'react';
import PropTypes from 'prop-types';

import {
Expand Down Expand Up @@ -64,17 +64,15 @@ export const FieldList = ({
};

return (
<Fragment>
<EuiInMemoryTable
items={fields}
itemId="name"
columns={extendedColumns}
search={search}
pagination={pagination}
sorting={true}
message={message}
/>
</Fragment>
<EuiInMemoryTable
items={fields}
itemId="name"
columns={extendedColumns}
search={search}
pagination={pagination}
sorting={true}
message={message}
/>
);
};

Expand Down
Loading