mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Discover] [Alerting] Make 'Test query' button pretty (#134605)
* [Discover] [Alerting] Made 'Test query' button in 'Create rule' flyout pretty * [Discover] [Alerting] Fixed broken 'Test query' button tests
This commit is contained in:
parent
1e5b0d4c8b
commit
f0f2a05297
2 changed files with 9 additions and 9 deletions
|
@ -179,7 +179,7 @@ describe('EsQueryAlertTypeExpression', () => {
|
|||
expect(wrapper.find('[data-test-subj="thresholdExpression"]').exists()).toBeTruthy();
|
||||
expect(wrapper.find('[data-test-subj="forLastExpression"]').exists()).toBeTruthy();
|
||||
|
||||
const testQueryButton = wrapper.find('EuiButtonEmpty[data-test-subj="testQuery"]');
|
||||
const testQueryButton = wrapper.find('EuiButton[data-test-subj="testQuery"]');
|
||||
expect(testQueryButton.exists()).toBeTruthy();
|
||||
expect(testQueryButton.prop('disabled')).toBe(false);
|
||||
});
|
||||
|
@ -189,7 +189,7 @@ describe('EsQueryAlertTypeExpression', () => {
|
|||
...defaultEsQueryExpressionParams,
|
||||
timeField: null,
|
||||
} as unknown as EsQueryAlertParams<SearchType.esQuery>);
|
||||
const testQueryButton = wrapper.find('EuiButtonEmpty[data-test-subj="testQuery"]');
|
||||
const testQueryButton = wrapper.find('EuiButton[data-test-subj="testQuery"]');
|
||||
expect(testQueryButton.exists()).toBeTruthy();
|
||||
expect(testQueryButton.prop('disabled')).toBe(true);
|
||||
});
|
||||
|
@ -204,7 +204,7 @@ describe('EsQueryAlertTypeExpression', () => {
|
|||
});
|
||||
dataMock.search.search.mockImplementation(() => searchResponseMock$);
|
||||
const wrapper = await setup(defaultEsQueryExpressionParams);
|
||||
const testQueryButton = wrapper.find('EuiButtonEmpty[data-test-subj="testQuery"]');
|
||||
const testQueryButton = wrapper.find('EuiButton[data-test-subj="testQuery"]');
|
||||
|
||||
testQueryButton.simulate('click');
|
||||
expect(dataMock.search.search).toHaveBeenCalled();
|
||||
|
@ -225,7 +225,7 @@ describe('EsQueryAlertTypeExpression', () => {
|
|||
throw new Error('What is this query');
|
||||
});
|
||||
const wrapper = await setup(defaultEsQueryExpressionParams);
|
||||
const testQueryButton = wrapper.find('EuiButtonEmpty[data-test-subj="testQuery"]');
|
||||
const testQueryButton = wrapper.find('EuiButton[data-test-subj="testQuery"]');
|
||||
|
||||
testQueryButton.simulate('click');
|
||||
expect(dataMock.search.search).toHaveBeenCalled();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { EuiButtonEmpty, EuiFormRow, EuiText } from '@elastic/eui';
|
||||
import { EuiButton, EuiFormRow, EuiText } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { useTestQuery } from './use_test_query';
|
||||
|
||||
|
@ -21,21 +21,21 @@ export function TestQueryRow({
|
|||
return (
|
||||
<>
|
||||
<EuiFormRow>
|
||||
<EuiButtonEmpty
|
||||
<EuiButton
|
||||
data-test-subj="testQuery"
|
||||
color="primary"
|
||||
iconSide="left"
|
||||
flush="left"
|
||||
iconType="play"
|
||||
iconType="playFilled"
|
||||
onClick={onTestQuery}
|
||||
disabled={hasValidationErrors}
|
||||
isLoading={testQueryLoading}
|
||||
size="s"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="xpack.stackAlerts.esQuery.ui.testQuery"
|
||||
defaultMessage="Test query"
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
</EuiButton>
|
||||
</EuiFormRow>
|
||||
{testQueryLoading && (
|
||||
<EuiFormRow>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue