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
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.
  • Loading branch information
scottybollinger committed Jan 27, 2022
1 parent b1b04d2 commit 0765a22
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 0765a22

Please sign in to comment.