Skip to content

Commit

Permalink
Refactor: src/screens/UserPortal/Volunteer/Actions from Jest to Vitest (
Browse files Browse the repository at this point in the history
#2619)

* migrate jest to vitetst

* migrate jest to vitetst

* migrate jest to vitetst ignore

* migrate jest to vitetst eslint fix

* ignore action.tsx

* migrate jest to vitetst vite config change

* coderabbitai asked changes

* revert vitest.config.ts

* fixing merge issue

* tsdoc issue fix

* Enhance the useNavigate mock implementation.

* trying to inc code range

* test failing fix

* test  fix

* test fail fix trying

* fix organization issue ts

* action.spec waitfor issue fix

* excluded uncessary file

* fix test failed issue

* yearlyEvent calender coverage increase

* inc code cov

* setting revert back

* setting revert

* organisation covergae

* unwanted file

* ignoring covergae for setup.ts

* ignoring setup.ts

* revert back changes

* removing ignore comment

* schema fix

* schema fix

* test to spec

* revert test to spec

* revert pull req change

* codeai to resole

* codeai to resole

* removing spec file from jest

* code coverage fix

* code coverage fix

* code coverage fix

* code patch inc

* code patch inc

* inc path coverage for eventstatiscs

---------

Co-authored-by: Vamshi Maskuri <[email protected]>
Co-authored-by: Mayankpulse333 <[email protected]>
  • Loading branch information
3 people authored Dec 21, 2024
1 parent 651aa71 commit 4144fe7
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 53 deletions.
220 changes: 220 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,20 @@ export const AttendanceStatisticsModal: React.FC<
try {
const eventDate = new Date(event.startDate);
if (Number.isNaN(eventDate.getTime())) {
/*istanbul ignore next*/
console.error(`Invalid date for event: ${event._id}`);
/*istanbul ignore next*/

return 'Invalid date';
}
return eventDate.toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
});
} catch (error) {
/*istanbul ignore next*/
console.error(
`Error formatting date for event: ${event._id}`,
error,
);
/*istanbul ignore next*/

return 'Invalid date';
}
})();
Expand Down Expand Up @@ -325,7 +323,6 @@ export const AttendanceStatisticsModal: React.FC<
exportToCSV(data, `${selectedCategory.toLowerCase()}_demographics.csv`);
}, [selectedCategory, categoryLabels, categoryData]);

/*istanbul ignore next*/
const handleExport = (eventKey: string | null): void => {
switch (eventKey) {
case 'trends':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ describe('Testing OrganizationScreen', () => {
const openButton = screen.getByTestId('openMenu');
fireEvent.click(openButton);

// Check for expand class after opening
expect(screen.getByTestId('mainpageright')).toHaveClass(styles.contract);
});

Expand Down
1 change: 1 addition & 0 deletions src/screens/UserPortal/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default function settings(): JSX.Element {
* This function sends a mutation request to update the user details
* and reloads the page on success.
*/

/*istanbul ignore next*/
const handleUpdateUserDetails = async (): Promise<void> => {
try {
Expand Down
Loading

0 comments on commit 4144fe7

Please sign in to comment.