forked from PalisadoesFoundation/talawa-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bbe47e
commit 425f956
Showing
1 changed file
with
0 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1243,103 +1243,6 @@ describe('People Component Additional Coverage Tests', () => { | |
await new Promise((resolve) => setTimeout(resolve, 100)); | ||
}); | ||
|
||
it('renders sliced members correctly when rowsPerPage > 0', async () => { | ||
const localMocks = [ | ||
{ | ||
request: { | ||
query: ORGANIZATIONS_MEMBER_CONNECTION_LIST, | ||
variables: { orgId: '', firstName_contains: '' }, | ||
}, | ||
result: { | ||
data: { | ||
organizationsMemberConnection: { | ||
edges: Array.from({ length: 6 }, (_, i) => ({ | ||
_id: `id-${i}`, | ||
firstName: `First${i}`, | ||
lastName: `Last${i}`, | ||
image: '', | ||
email: `test${i}@example.com`, | ||
userType: 'Member', | ||
})), | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
request: { | ||
query: ORGANIZATION_ADMINS_LIST, | ||
variables: { id: '' }, | ||
}, | ||
result: { | ||
data: { | ||
organizations: [{ _id: 'org-1', admins: [] }], | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
render( | ||
<MockedProvider mocks={localMocks} addTypename={false}> | ||
<People /> | ||
</MockedProvider>, | ||
); | ||
|
||
await waitFor(() => { | ||
expect(screen.getByText('First0 Last0')).toBeInTheDocument(); | ||
expect(screen.getByText('First4 Last4')).toBeInTheDocument(); | ||
expect(screen.queryByText('First5 Last5')).not.toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
it('passes expected props to PeopleCard components', async () => { | ||
const localMocks = [ | ||
{ | ||
request: { | ||
query: ORGANIZATIONS_MEMBER_CONNECTION_LIST, | ||
variables: { orgId: '', firstName_contains: '' }, | ||
}, | ||
result: { | ||
data: { | ||
organizationsMemberConnection: { | ||
edges: [ | ||
{ | ||
_id: 'mockId1', | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
image: 'mockImage', | ||
email: '[email protected]', | ||
userType: 'Member', | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
request: { | ||
query: ORGANIZATION_ADMINS_LIST, | ||
variables: { id: '' }, | ||
}, | ||
result: { | ||
data: { | ||
organizations: [{ _id: 'org-1', admins: [] }], | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
render( | ||
<MockedProvider mocks={localMocks} addTypename={false}> | ||
<People /> | ||
</MockedProvider>, | ||
); | ||
|
||
await waitFor(() => { | ||
expect(screen.getByText('John Doe')).toBeInTheDocument(); | ||
expect(screen.getByText('[email protected]')).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
it('Sets userType to Admin if user is found in admins list', async (): Promise<void> => { | ||
const adminMock = { | ||
request: { | ||
|