Skip to content

Commit

Permalink
removed duplicate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhiren-Mhatre committed Jan 18, 2025
1 parent 9bbe47e commit 425f956
Showing 1 changed file with 0 additions and 97 deletions.
97 changes: 0 additions & 97 deletions src/screens/UserPortal/People/People.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 425f956

Please sign in to comment.