Skip to content

Commit

Permalink
[ML] Revert ml data test subj/class name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Jun 7, 2021
1 parent 200f874 commit aaf142c
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.dataVisualizerDataGridChart__histogram {
.mlDataGridChart__histogram {
width: 100%;
height: $euiSizeXL + $euiSizeXXL;
}

.dataVisualizerDataGridChart__legend {
.mlDataGridChart__legend {
@include euiTextTruncate;
@include euiFontSizeXS;

Expand All @@ -16,11 +16,11 @@
text-align: left;
}

.dataVisualizerDataGridChart__legend--numeric {
.mlDataGridChart__legend--numeric {
text-align: right;
}

.dataVisualizerDataGridChart__legendBoolean {
.mlDataGridChart__legendBoolean {
width: 100%;
min-width: $euiButtonMinWidth;
td { text-align: center }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ export const ColumnChart: FC<Props> = ({
return (
<div data-test-subj={dataTestSubj}>
{!isUnsupportedChartData(chartData) && data.length > 0 && (
<div
className="dataVisualizerDataGridChart__histogram"
data-test-subj={`${dataTestSubj}-histogram`}
>
<div className="mlDataGridChart__histogram" data-test-subj={`${dataTestSubj}-histogram`}>
<Chart>
<Settings theme={columnChartTheme} />
<BarSeries
Expand All @@ -73,9 +70,9 @@ export const ColumnChart: FC<Props> = ({
</div>
)}
<div
className={classNames('dataVisualizerDataGridChart__legend', {
className={classNames('mlDataGridChart__legend', {
// eslint-disable-next-line @typescript-eslint/naming-convention
'dataVisualizerDataGridChart__legend--numeric': columnType.schema === 'number',
'mlDataGridChart__legend--numeric': columnType.schema === 'number',
})}
data-test-subj={`${dataTestSubj}-legend`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const getLegendText = (

if (chartData.type === 'boolean') {
return (
<table className="dataVisualizerDataGridChart__legendBoolean">
<table className="mlDataGridChart__legendBoolean">
<tbody>
<tr>
{chartData.data[0] !== undefined && <td>{chartData.data[0].key_as_string}</td>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const useDataGrid = (
<ColumnChart
chartData={chartData}
columnType={c}
dataTestSubj={`dataVisualizerDataGridChart-${c.id}`}
dataTestSubj={`mlDataGridChart-${c.id}`}
/>
) : undefined,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.dataVisualizerEmbeddedMapContent {
.mlEmbeddedMapContent {
width: 100%;
height: 100%;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export function MlEmbeddedMapComponent({

return (
<div
data-test-subj="dataVisualizerEmbeddedMapContent"
className="dataVisualizerEmbeddedMapContent"
data-test-subj="mlEmbeddedMapContent"
className="mlEmbeddedMapContent"
ref={embeddableRoot}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ export const DatavisualizerSelector: FC = () => {
<EuiButton
target="_self"
onClick={() => navigateToPath('/filedatavisualizer')}
data-test-subj="dataVisualizerUploadFileButton"
data-test-subj="mlDataVisualizerUploadFileButton"
>
<FormattedMessage
id="xpack.ml.datavisualizer.selector.uploadFileButtonLabel"
defaultMessage="Select file"
/>
</EuiButton>
}
data-test-subj="dataVisualizerCardImportData"
data-test-subj="mlDataVisualizerCardImportData"
/>
</EuiFlexItem>
<EuiFlexItem>
Expand All @@ -168,15 +168,15 @@ export const DatavisualizerSelector: FC = () => {
<EuiButton
target="_self"
onClick={() => navigateToPath('/datavisualizer_index_select')}
data-test-subj="dataVisualizerSelectIndexButton"
data-test-subj="mlDataVisualizerSelectIndexButton"
>
<FormattedMessage
id="xpack.ml.datavisualizer.selector.selectIndexButtonLabel"
defaultMessage="Select index pattern"
/>
</EuiButton>
}
data-test-subj="dataVisualizerCardIndexData"
data-test-subj="mlDataVisualizerCardIndexData"
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -198,15 +198,15 @@ export const DatavisualizerSelector: FC = () => {
<EuiButton
target="_blank"
href={`${basePath.get()}/app/management/stack/license_management/home`}
data-test-subj="dataVisualizerStartTrialButton"
data-test-subj="mlDataVisualizerStartTrialButton"
>
<FormattedMessage
id="xpack.ml.datavisualizer.selector.startTrialButtonLabel"
defaultMessage="Start trial"
/>
</EuiButton>
}
data-test-subj="dataVisualizerCardStartTrial"
data-test-subj="mlDataVisualizerCardStartTrial"
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
16 changes: 8 additions & 8 deletions x-pack/test/functional/services/ml/data_visualizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ export function MachineLearningDataVisualizerProvider({ getService }: FtrProvide

return {
async assertDataVisualizerImportDataCardExists() {
await testSubjects.existOrFail('dataVisualizerCardImportData');
await testSubjects.existOrFail('mlDataVisualizerCardImportData');
},

async assertDataVisualizerIndexDataCardExists() {
await testSubjects.existOrFail('dataVisualizerCardIndexData');
await testSubjects.existOrFail('mlDataVisualizerCardIndexData');
},

async assertDataVisualizerStartTrialCardExists() {
await testSubjects.existOrFail('dataVisualizerCardStartTrial');
await testSubjects.existOrFail('mlDataVisualizerCardStartTrial');
},

async assertSelectIndexButtonEnabled(expectedValue: boolean) {
const isEnabled = await testSubjects.isEnabled('dataVisualizerSelectIndexButton');
const isEnabled = await testSubjects.isEnabled('mlDataVisualizerSelectIndexButton');
expect(isEnabled).to.eql(
expectedValue,
`Expected "select index" button to be '${expectedValue ? 'enabled' : 'disabled'}' (got '${
Expand All @@ -36,7 +36,7 @@ export function MachineLearningDataVisualizerProvider({ getService }: FtrProvide
},

async assertUploadFileButtonEnabled(expectedValue: boolean) {
const isEnabled = await testSubjects.isEnabled('dataVisualizerUploadFileButton');
const isEnabled = await testSubjects.isEnabled('mlDataVisualizerUploadFileButton');
expect(isEnabled).to.eql(
expectedValue,
`Expected "upload file" button to be '${expectedValue ? 'enabled' : 'disabled'}' (got '${
Expand All @@ -46,7 +46,7 @@ export function MachineLearningDataVisualizerProvider({ getService }: FtrProvide
},

async assertStartTrialButtonEnabled(expectedValue: boolean) {
const isEnabled = await testSubjects.isEnabled('dataVisualizerStartTrialButton');
const isEnabled = await testSubjects.isEnabled('mlDataVisualizerStartTrialButton');
expect(isEnabled).to.eql(
expectedValue,
`Expected "start trial" button to be '${expectedValue ? 'enabled' : 'disabled'}' (got '${
Expand All @@ -56,12 +56,12 @@ export function MachineLearningDataVisualizerProvider({ getService }: FtrProvide
},

async navigateToIndexPatternSelection() {
await testSubjects.click('dataVisualizerSelectIndexButton');
await testSubjects.click('mlDataVisualizerSelectIndexButton');
await testSubjects.existOrFail('mlPageSourceSelection');
},

async navigateToFileUpload() {
await testSubjects.click('dataVisualizerUploadFileButton');
await testSubjects.click('mlDataVisualizerUploadFileButton');
await testSubjects.existOrFail('dataVisualizerPageFileUpload');
},
};
Expand Down

0 comments on commit aaf142c

Please sign in to comment.