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

[ML] Add functional testing for continuous transforms (creation, start, stop, reset) #156128

Merged
merged 10 commits into from
May 3, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ export const StepDetailsForm: FC<StepDetailsFormProps> = React.memo(
)}
>
<EuiSelect
options={dateFieldNames.map((text: string) => ({ text }))}
options={dateFieldNames.map((text: string) => ({ text, value: text }))}
value={continuousModeDateField}
onChange={(e) => setContinuousModeDateField(e.target.value)}
data-test-subj="transformContinuousDateFieldSelect"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Transform: Transform List <ExpandedRow />', () => {

await waitFor(() => {
expect(screen.getByTestId('transformStatsTab')).toHaveAttribute('aria-selected', 'true');
const tabContent = screen.getByTestId('transformDetailsTabContent');
const tabContent = screen.getByTestId('transformStatsTabContent');
expect(within(tabContent).getByText('Stats')).toBeInTheDocument();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export const ExpandedRow: FC<Props> = ({ item, onAlertEdit }) => {
checkpointing,
...(alertingRules.items ? [alertingRules] : []),
]}
dataTestSubj={'transformDetailsTabContent'}
/>
),
},
Expand All @@ -252,7 +253,9 @@ export const ExpandedRow: FC<Props> = ({ item, onAlertEdit }) => {
defaultMessage: 'Stats',
}
),
content: <ExpandedRowDetailsPane sections={[stats]} />,
content: (
<ExpandedRowDetailsPane sections={[stats]} dataTestSubj={'transformStatsTabContent'} />
),
},
{
id: `transform-json-tab-${tabId}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ export const Section: FC<SectionProps> = ({ section }) => {

interface ExpandedRowDetailsPaneProps {
sections: SectionConfig[];
dataTestSubj?: string;
}

export const ExpandedRowDetailsPane: FC<ExpandedRowDetailsPaneProps> = ({ sections }) => {
export const ExpandedRowDetailsPane: FC<ExpandedRowDetailsPaneProps> = ({
sections,
dataTestSubj,
}) => {
return (
<div data-test-subj="transformDetailsTabContent">
<div data-test-subj={dataTestSubj ?? 'transformDetailsTabContent'}>
<EuiFlexGroup>
<EuiFlexItem style={{ width: '50%' }}>
{sections
Expand Down
Loading