Skip to content

Commit

Permalink
[ML] Update transform_table and expanded_row tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Jun 17, 2020
1 parent 93e70a0 commit 5e36794
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ describe('Transform: Transform List Actions', () => {
const actions = getActions({ forceDisable: false });

expect(actions).toHaveLength(4);
expect(actions[0].isPrimary).toBeTruthy();
expect(typeof actions[0].render).toBe('function');
expect(typeof actions[1].render).toBe('function');
expect(typeof actions[2].render).toBe('function');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { StopAction } from './action_stop';
export const getActions = ({ forceDisable }: { forceDisable: boolean }) => {
return [
{
isPrimary: true,
render: (item: TransformListRow) => {
if (item.stats.state === TRANSFORM_STATE.STOPPED) {
return <StartAction items={[item]} forceDisable={forceDisable} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export const getColumns = (
{
name: i18n.translate('xpack.transform.tableActionLabel', { defaultMessage: 'Actions' }),
actions,
width: '100px',
width: '80px',
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ describe('Transform: Transform List <ExpandedRow />', () => {

const { getByText, getByTestId } = render(<ExpandedRow item={item} />);

expect(getByText('Settings')).toBeInTheDocument();
expect(getByText('Details')).toBeInTheDocument();
expect(getByText('Stats')).toBeInTheDocument();
expect(getByText('JSON')).toBeInTheDocument();
Expand All @@ -41,7 +40,7 @@ describe('Transform: Transform List <ExpandedRow />', () => {
const tabContent = getByTestId('transformDetailsTabContent');
expect(tabContent).toBeInTheDocument();

expect(getByTestId('transformSettingsTab')).toHaveAttribute('aria-selected', 'true');
expect(getByTestId('transformDetailsTab')).toHaveAttribute('aria-selected', 'true');
expect(within(tabContent).getByText('General')).toBeInTheDocument();

fireEvent.click(getByTestId('transformStatsTab'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
const state: SectionConfig = {
title: 'State',
items: stateItems,
position: 'left',
position: 'right',
};

const configItems: Item[] = [
Expand Down Expand Up @@ -96,7 +96,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
},
];

const settings: SectionConfig = {
const general: SectionConfig = {
title: 'General',
items: configItems,
position: 'left',
Expand Down Expand Up @@ -158,18 +158,6 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
};

const tabs = [
{
id: `transform-settings-tab-${item.id}`,
'data-test-subj': 'transformSettingsTab',
name: i18n.translate(
'xpack.transform.transformList.transformDetails.tabs.transformSettingsLabel',
{
defaultMessage: 'Settings',
}
),
content: <ExpandedRowDetailsPane sections={[settings]} />,
},

{
id: `transform-details-tab-${item.id}`,
'data-test-subj': 'transformDetailsTab',
Expand All @@ -179,7 +167,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
defaultMessage: 'Details',
}
),
content: <ExpandedRowDetailsPane sections={[state, checkpointing]} />,
content: <ExpandedRowDetailsPane sections={[general, state, checkpointing]} />,
},
{
id: `transform-stats-tab-${item.id}`,
Expand Down

0 comments on commit 5e36794

Please sign in to comment.