mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* [Alerting UI] Fixed bug Search is not reset in Create rule flyout (#117807) * [Alerting UI] Fixed bug Search is not reset in Create rule flyout * fixed types * fixed test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
fe1e60fecb
commit
01ec98c8f4
2 changed files with 26 additions and 1 deletions
|
@ -764,7 +764,12 @@ export const AlertForm = ({
|
|||
<EuiFieldSearch
|
||||
fullWidth
|
||||
data-test-subj="alertSearchField"
|
||||
onChange={(e) => setInputText(e.target.value)}
|
||||
onChange={(e) => {
|
||||
setInputText(e.target.value);
|
||||
if (e.target.value === '') {
|
||||
setSearchText('');
|
||||
}
|
||||
}}
|
||||
onKeyUp={(e) => {
|
||||
if (e.keyCode === ENTER_KEY) {
|
||||
setSearchText(inputText);
|
||||
|
|
|
@ -18,6 +18,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
const find = getService('find');
|
||||
const retry = getService('retry');
|
||||
const comboBox = getService('comboBox');
|
||||
const browser = getService('browser');
|
||||
|
||||
async function getAlertsByName(name: string) {
|
||||
const {
|
||||
|
@ -291,5 +292,24 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
await testSubjects.missingOrFail('testQuerySuccess');
|
||||
await testSubjects.existOrFail('testQueryError');
|
||||
});
|
||||
|
||||
it('should show all rule types on click euiFormControlLayoutClearButton', async () => {
|
||||
await pageObjects.triggersActionsUI.clickCreateAlertButton();
|
||||
await testSubjects.setValue('alertNameInput', 'alertName');
|
||||
const ruleTypeSearchBox = await find.byCssSelector('[data-test-subj="alertSearchField"]');
|
||||
await ruleTypeSearchBox.type('notexisting rule type');
|
||||
await ruleTypeSearchBox.pressKeys(browser.keys.ENTER);
|
||||
|
||||
const ruleTypes = await find.allByCssSelector('.triggersActionsUI__alertTypeNodeHeading');
|
||||
expect(ruleTypes).to.have.length(0);
|
||||
|
||||
const searchClearButton = await find.byCssSelector('.euiFormControlLayoutClearButton');
|
||||
await searchClearButton.click();
|
||||
|
||||
const ruleTypesClearFilter = await find.allByCssSelector(
|
||||
'.triggersActionsUI__alertTypeNodeHeading'
|
||||
);
|
||||
expect(ruleTypesClearFilter.length).to.above(0);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue