-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Update id of second sources mock to be unique Both were originally set to ‘123’ * Remove unused types from interface These were never used and were only uncovered while testing. These both exist on `group` but not at the top level. * Add group mock * Fix typo in reducer name * Add tests for group_logic * Remove redundant messages check This is not needed with global flash messages, as the component will not render with no messages. * Add tests for group_router * Add group mock * Add tests for groups_logic * Convert groups_router to use children This allow for testing the component visiblity and aligns with other usage of React Router * Add tests for groups_router * Refactor pagination logic This commit removes the useDidUpdateEffect custom hook and moves the logic to fetch the search results to a listener inside of Kea. * dd tests for main groups container * Lint fixes * Fix broken test and remove comment The issue was that the delay needed to be in the catch block to properly execute. * Add comments and make test explicit In other places in the tests, we explicitly test for an error string in the catch block. Changing this to match. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
eb05a56
commit 837f464
Showing
17 changed files
with
1,324 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
x-pack/plugins/enterprise_search/public/applications/shared/use_did_update_effect/index.ts
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
...se_search/public/applications/shared/use_did_update_effect/use_did_update_effect.test.tsx
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
...erprise_search/public/applications/shared/use_did_update_effect/use_did_update_effect.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...se_search/public/applications/workplace_search/views/groups/__mocks__/group_logic.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { IGroupValues } from '../group_logic'; | ||
|
||
import { IGroupDetails, ISourcePriority } from '../../../types'; | ||
|
||
export const mockGroupValues = { | ||
group: {} as IGroupDetails, | ||
dataLoading: true, | ||
manageUsersModalVisible: false, | ||
managerModalFormErrors: [], | ||
sharedSourcesModalVisible: false, | ||
confirmDeleteModalVisible: false, | ||
groupNameInputValue: '', | ||
selectedGroupSources: [], | ||
selectedGroupUsers: [], | ||
groupPrioritiesUnchanged: true, | ||
activeSourcePriorities: {} as ISourcePriority, | ||
cachedSourcePriorities: {} as ISourcePriority, | ||
} as IGroupValues; |
32 changes: 32 additions & 0 deletions
32
...e_search/public/applications/workplace_search/views/groups/__mocks__/groups_logic.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { IGroupsValues } from '../groups_logic'; | ||
|
||
import { IContentSource, IUser, IGroup } from '../../../types'; | ||
|
||
import { DEFAULT_META } from '../../../../shared/constants'; | ||
|
||
export const mockGroupsValues = { | ||
groups: [] as IGroup[], | ||
contentSources: [] as IContentSource[], | ||
users: [] as IUser[], | ||
groupsDataLoading: true, | ||
groupListLoading: true, | ||
newGroupModalOpen: false, | ||
newGroupName: '', | ||
hasFiltersSet: false, | ||
newGroup: null, | ||
newGroupNameErrors: [], | ||
filterSourcesDropdownOpen: false, | ||
filteredSources: [], | ||
filterUsersDropdownOpen: false, | ||
filteredUsers: [], | ||
allGroupUsersLoading: false, | ||
allGroupUsers: [], | ||
filterValue: '', | ||
groupsMeta: DEFAULT_META, | ||
} as IGroupsValues; |
Oops, something went wrong.