[RAM] Unselect items and close dropdown (#146974)

## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
This commit is contained in:
Julia 2022-12-06 22:41:19 +01:00 committed by GitHub
parent 9f7db8f615
commit 87d1e8b6db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -1047,6 +1047,7 @@ export const RulesList = ({
setIsEnablingRules(false);
showToast({ action: 'ENABLE', errors, total });
await refreshRules();
onClearSelection();
}, [http, selectedIds, getFilter, setIsEnablingRules, showToast]);
const onDisable = useCallback(async () => {
@ -1061,6 +1062,7 @@ export const RulesList = ({
setIsDisablingRules(false);
showToast({ action: 'DISABLE', errors, total });
await refreshRules();
onClearSelection();
}, [http, selectedIds, getFilter, setIsDisablingRules, showToast]);
const onDeleteCancel = () => {

View file

@ -154,7 +154,7 @@ describe.skip('Rules list bulk disable', () => {
wrapper.find('[data-test-subj="showBulkActionButton"]').first().simulate('click');
});
it('can bulk disable', async () => {
it.skip('can bulk disable', async () => {
wrapper.find('button[data-test-subj="bulkDisable"]').first().simulate('click');
await act(async () => {
@ -175,6 +175,10 @@ describe.skip('Rules list bulk disable', () => {
ids: [],
})
);
expect(
wrapper.find('[data-test-subj="checkboxSelectRow-1"]').first().prop('checked')
).toBeFalsy();
expect(wrapper.find('button[data-test-subj="bulkDisable"]').exists()).toBeFalsy();
});
describe('Toast', () => {

View file

@ -175,6 +175,10 @@ describe.skip('Rules list bulk enable', () => {
ids: [],
})
);
expect(
wrapper.find('[data-test-subj="checkboxSelectRow-1"]').first().prop('checked')
).toBeFalsy();
expect(wrapper.find('button[data-test-subj="bulkEnable"]').exists()).toBeFalsy();
});
describe('Toast', () => {