Skip to content

Commit

Permalink
some iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
duplixx committed Nov 1, 2024
1 parent 99fdd0d commit 62c574c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ const recurringMocks = [
startDate: new Date().toISOString(),
attendees: mockMemberData,
},
getRecurringEvents: undefined, // Explicitly set undefined here
},
},
},
Expand All @@ -109,14 +108,19 @@ const recurringMocks = [
_id: `event${i}`,
title: `Event ${i}`,
startDate: new Date(2023, 4, i + 1).toISOString(),
endDate: new Date(2023, 4, i + 1).toISOString(),
frequency: 'WEEKLY',
interval: 1,
attendees: mockMemberData.map((member) => ({
...member,
_id: `${member._id}_${i}`,
eventsAttended: member?.eventsAttended?.map((event) => ({
...event,
_id: `${event._id}_${i}`,
})),
gender: member.gender as
| 'MALE'
| 'FEMALE'
| 'OTHER'
| 'PREFER_NOT_TO_SAY',
})),
isPublic: true,
isRegisterable: true,
})),
},
},
Expand All @@ -137,6 +141,7 @@ const renderModal = (
attendanceRate: 40,
}}
memberData={mockMemberData}
t={(key: string) => key}
/>
</MockedProvider>,
);
Expand Down Expand Up @@ -255,7 +260,6 @@ describe('AttendanceStatisticsModal', () => {
});

fireEvent.click(screen.getByTestId('export-dropdown'));
// Add assertions related to the export functionality here
});

it('closes modal when close button is clicked', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ import type {
} from './InterfaceEvents';
import { toast } from 'react-toastify';

const CHART_COLORS = {
primary: '#1f77b4', // Color-blind friendly blue
secondary: '#ff7f0e', // Color-blind friendly orange
tertiary: '#2ca02c', // Color-blind friendly green
};
export const AttendanceStatisticsModal: React.FC<
InterfaceAttendanceStatisticsModalProps
> = ({ show, handleClose, statistics, memberData, t }): JSX.Element => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface InterfaceMember {
createdAt: string;
firstName: string;
lastName: string;
email: string;
email: `${string}@${string}.${string}`;
gender: string;
eventsAttended?: {
_id: string;
Expand Down Expand Up @@ -69,8 +69,13 @@ export interface InterfaceRecurringEvent {
_id: string;
title: string;
startDate: string;
endDate: string;
frequency: InterfaceEvent['recurrenceRule']['frequency'];
interval: InterfaceEvent['recurrenceRule']['interval'];
attendees: {
_id: string;
gender: string;
gender: 'MALE' | 'FEMALE' | 'OTHER' | 'PREFER_NOT_TO_SAY';
}[];
isPublic: boolean;
isRegisterable: boolean;
}

0 comments on commit 62c574c

Please sign in to comment.