Skip to content

Commit

Permalink
new commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaRaimec22 committed May 12, 2024
1 parent c3507b9 commit 6932607
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
28 changes: 21 additions & 7 deletions src/components/InviteUsers/InviteUsersModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,21 +424,29 @@ describe('InviteUserModal Component', () => {
<InviteUserModal {...props} />
</Provider>
</BrowserRouter>
</MockedProvider>
</MockedProvider>,
);

await waitFor(() => expect(getByText('Invite Event Attendee')).toBeInTheDocument());
await waitFor(() =>
expect(getByText('Invite Event Attendee')).toBeInTheDocument(),
);

// Simulate selecting a user
fireEvent.change(getByLabelText('Add an Registrant'), {
target: { value: 'John Doe' },
});
fireEvent.keyDown(getByLabelText('Add an Registrant'), { key: 'ArrowDown' });
fireEvent.keyDown(getByLabelText('Add an Registrant'), {
key: 'ArrowDown',
});
fireEvent.keyDown(getByLabelText('Add an Registrant'), { key: 'Enter' });

fireEvent.click(getByText('Invite Attendee'));

await waitFor(() => expect(getByText('Invited the Attendee successfully!')).toBeInTheDocument());
await waitFor(() =>
expect(
getByText('Invited the Attendee successfully!'),
).toBeInTheDocument(),
);
});

test('handles invite user mutation failure', async () => {
Expand All @@ -456,13 +464,19 @@ describe('InviteUserModal Component', () => {
<InviteUserModal {...props} />
</Provider>
</BrowserRouter>
</MockedProvider>
</MockedProvider>,
);

await waitFor(() => expect(getByText('Invite Event Attendee')).toBeInTheDocument());
await waitFor(() =>
expect(getByText('Invite Event Attendee')).toBeInTheDocument(),
);

fireEvent.click(getByText('Invite Attendee'));

await waitFor(() => expect(getByText('There was an error in adding the attendee!')).toBeInTheDocument());
await waitFor(() =>
expect(
getByText('There was an error in adding the attendee!'),
).toBeInTheDocument(),
);
});
});
2 changes: 1 addition & 1 deletion src/components/InviteUsers/InviteUsersWrapper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe('Testing InviteUsersWrapper Component', () => {
</Provider>
</LocalizationProvider>
</BrowserRouter>
</MockedProvider>
</MockedProvider>,
);

// Open the modal
Expand Down
2 changes: 1 addition & 1 deletion src/components/LeftDrawerEvent/LeftDrawerEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface InterfaceLeftDrawerProps {
}

const leftDrawerEvent = ({
event,
event,
hideDrawer,
}: InterfaceLeftDrawerProps): JSX.Element => {
const [revokeRefreshToken] = useMutation(REVOKE_REFRESH_TOKEN);
Expand Down

0 comments on commit 6932607

Please sign in to comment.