diff --git a/packages/shared/src/features/profile/components/ProfileWidgets/BadgesAndAwards.spec.tsx b/packages/shared/src/features/profile/components/ProfileWidgets/BadgesAndAwards.spec.tsx index c3e207abed..1e3d509619 100644 --- a/packages/shared/src/features/profile/components/ProfileWidgets/BadgesAndAwards.spec.tsx +++ b/packages/shared/src/features/profile/components/ProfileWidgets/BadgesAndAwards.spec.tsx @@ -193,7 +193,7 @@ describe('BadgesAndAwards component', () => { }); // Check summary cards - expect(screen.getByText('x8')).toBeInTheDocument(); // Total badges: 5 + 3 + expect(screen.getByText('x5')).toBeInTheDocument(); expect(screen.getByText('Top reader badge')).toBeInTheDocument(); // Check badge items @@ -245,7 +245,7 @@ describe('BadgesAndAwards component', () => { renderComponent(); expect(screen.getByText('Badges & Awards')).toBeInTheDocument(); - expect(screen.getByText('x8')).toBeInTheDocument(); // Total badges + expect(screen.getByText('x5')).toBeInTheDocument(); expect(screen.getByText('x0')).toBeInTheDocument(); // No awards expect(screen.queryByAltText('Award')).not.toBeInTheDocument(); }); diff --git a/packages/shared/src/features/profile/components/ProfileWidgets/BadgesAndAwards.tsx b/packages/shared/src/features/profile/components/ProfileWidgets/BadgesAndAwards.tsx index a058b2248d..c6964ca50c 100644 --- a/packages/shared/src/features/profile/components/ProfileWidgets/BadgesAndAwards.tsx +++ b/packages/shared/src/features/profile/components/ProfileWidgets/BadgesAndAwards.tsx @@ -58,9 +58,6 @@ export const BadgesAndAwards = ({ return null; } - const totalTopReaderBadges = - topReaders?.reduce((sum, topReader) => sum + (topReader?.total || 0), 0) ?? - 0; const totalAwards = awards?.reduce((sum, award) => sum + (award?.count || 0), 0) ?? 0; @@ -86,7 +83,7 @@ export const BadgesAndAwards = ({