Skip to content

Commit

Permalink
[Workplace Search] Fix bug where modal visible after deleting a group (
Browse files Browse the repository at this point in the history
…elastic#123976)

This PR fixes a bug in Workplace Search where, after you delete a group, the next group you click into will automatically show the delete modal for that group.

(cherry picked from commit 75f1e39)
  • Loading branch information
scottybollinger authored and kibanamachine committed Jan 27, 2022
1 parent fc23293 commit 2a3757c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ describe('GroupLogic', () => {
describe('deleteGroup', () => {
beforeEach(() => {
GroupLogic.actions.onInitializeGroup(group);
GroupLogic.actions.showConfirmDeleteModal();
});
it('deletes a group', async () => {
http.delete.mockReturnValue(Promise.resolve(true));

GroupLogic.actions.deleteGroup();
expect(GroupLogic.values.confirmDeleteModalVisible).toEqual(false);
expect(http.delete).toHaveBeenCalledWith('/internal/workplace_search/groups/123');

await nextTick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const GroupLogic = kea<MakeLogicType<GroupValues, GroupActions>>({
{
showConfirmDeleteModal: () => true,
hideConfirmDeleteModal: () => false,
deleteGroup: () => false,
},
],
groupNameInputValue: [
Expand Down

0 comments on commit 2a3757c

Please sign in to comment.