Skip to content

Commit

Permalink
resolved eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gopi kishan committed Jan 11, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 6096a3d commit f7b878f
Showing 3 changed files with 15 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/screens/OrganizationTags/OrganizationTags.spec.tsx
Original file line number Diff line number Diff line change
@@ -289,10 +289,15 @@ describe('Organisation Tags Page', () => {
expect(screen.getByTestId('createTagSubmitBtn')).toBeInTheDocument();
});

// Try to submit empty form
// Before submitting the form, we'll verify it exists
const form = screen.getByTestId('createTagSubmitBtn').closest('form');
if (form == null) {
throw new Error('Form not found');
}

// Submit empty form
await act(async () => {
fireEvent.submit(form!);
fireEvent.submit(form); // No non-null assertion here
});

// Wait for error toast
@@ -310,7 +315,7 @@ describe('Organisation Tags Page', () => {

// Submit form with valid data
await act(async () => {
fireEvent.submit(form!);
fireEvent.submit(form); // Again, no non-null assertion here
});

// Wait for success toast
9 changes: 6 additions & 3 deletions src/screens/UserPortal/Organizations/Organizations.tsx
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ export default function Organizations(): JSX.Element {

const handleResize = (): void => {
if (window.innerWidth <= 820) {
setHideDrawer(!hideDrawer);
setHideDrawer((prev) => !prev);
}
};

@@ -332,7 +332,7 @@ export default function Organizations(): JSX.Element {
page * rowsPerPage + rowsPerPage,
)
: organizations
).map((organization: InterfaceOrganization, index) => {
).map((organization: InterfaceOrganization) => {
const cardProps: InterfaceOrganizationCardProps = {
name: organization.name,
image: organization.image,
@@ -347,12 +347,15 @@ export default function Organizations(): JSX.Element {
organization.userRegistrationRequired,
membershipRequests: organization.membershipRequests,
};
return <OrganizationCard key={index} {...cardProps} />;
return (
<OrganizationCard key={organization._id} {...cardProps} />
);
})
) : (
<span>{t('nothingToShow')}</span>
)}
</div>

<table>
<tbody>
<tr>
1 change: 1 addition & 0 deletions talawa-admin
Submodule talawa-admin added at ba4d34

0 comments on commit f7b878f

Please sign in to comment.