Skip to content

Commit

Permalink
[ML] Adds functional tests for anomaly detection job custom URLs (#10…
Browse files Browse the repository at this point in the history
…0455)

* [ML] Adds functional tests for anomaly detection job custom URLs

* [ML] Remove debug test tag from custom URL tests

* [ML] Update custom URL editor Jest snapshots

* [ML] Clean up in embeddables tests to fix dashboard test

* [ML] Delete test dashboard after test suites complete

* [ML] Edits to custom URL tests following review

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
peteharverson and kibanamachine committed May 26, 2021
1 parent c5f8aee commit f77ff2d
Show file tree
Hide file tree
Showing 19 changed files with 622 additions and 16 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
</h4>
</EuiTitle>
<EuiSpacer size="m" />
<EuiForm className="ml-edit-url-form">
<EuiForm className="ml-edit-url-form" data-test-subj="mlJobCustomUrlForm">
<EuiFormRow
label={
<FormattedMessage id="xpack.ml.customUrlsEditor.labelLabel" defaultMessage="Label" />
Expand Down Expand Up @@ -239,6 +239,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
idSelected={type}
onChange={onTypeChange}
className="url-link-to-radio"
data-test-subj="mlJobCustomUrlLinkToTypeInput"
/>
</EuiFormRow>

Expand All @@ -256,6 +257,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
options={dashboardOptions}
value={kibanaSettings.dashboardId}
onChange={onDashboardChange}
data-test-subj="mlJobCustomUrlDashboardNameInput"
compressed
/>
</EuiFormRow>
Expand All @@ -275,6 +277,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
options={indexPatternOptions}
value={kibanaSettings.discoverIndexPatternId}
onChange={onDiscoverIndexPatternChange}
data-test-subj="mlJobCustomUrlDiscoverIndexPatternInput"
compressed
/>
</EuiFormRow>
Expand All @@ -298,6 +301,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
selectedOptions={selectedEntityOptions}
onChange={onQueryEntitiesChange}
isClearable={true}
data-test-subj="mlJobCustomUrlQueryEntitiesInput"
/>
</EuiFormRow>
)}
Expand All @@ -321,6 +325,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
options={timeRangeOptions}
value={timeRange.type}
onChange={onTimeRangeTypeChange}
data-test-subj="mlJobCustomUrlTimeRangeInput"
compressed
/>
</EuiFormRow>
Expand All @@ -343,6 +348,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
value={timeRange.interval}
onChange={onTimeRangeIntervalChange}
isInvalid={isInvalidTimeRange}
data-test-subj="mlJobCustomUrlTimeRangeIntervalInput"
compressed
/>
</EuiFormRow>
Expand All @@ -365,6 +371,7 @@ export const CustomUrlEditor: FC<CustomUrlEditorProps> = ({
rows={2}
value={otherUrlSettings.urlValue}
onChange={onOtherUrlValueChange}
data-test-subj="mlJobCustomUrlOtherTypeUrlInput"
compressed
/>
</EuiFormRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export const CustomUrlList: FC<CustomUrlListProps> = ({ job, customUrls, setCust
}
isInvalid={isInvalidLabel}
error={invalidLabelError}
data-test-subj="mlJobEditCustomUrlItemLabel"
>
<EuiFieldText
value={label}
Expand Down Expand Up @@ -239,6 +240,7 @@ export const CustomUrlList: FC<CustomUrlListProps> = ({ job, customUrls, setCust
aria-label={i18n.translate('xpack.ml.customUrlEditorList.testCustomUrlAriaLabel', {
defaultMessage: 'Test custom URL',
})}
data-test-subj="mlJobEditTestCustomUrlButton"
/>
</EuiToolTip>
</EuiFormRow>
Expand All @@ -264,6 +266,7 @@ export const CustomUrlList: FC<CustomUrlListProps> = ({ job, customUrls, setCust
defaultMessage: 'Delete custom URL',
}
)}
data-test-subj={`mlJobEditDeleteCustomUrlButton_${index}`}
/>
</EuiToolTip>
</EuiFormRow>
Expand Down
Loading

0 comments on commit f77ff2d

Please sign in to comment.