From 41313a2477bb04e0d66772e64185034d122f15f1 Mon Sep 17 00:00:00 2001 From: soufiane Date: Fri, 5 Dec 2025 11:27:40 +0100 Subject: [PATCH] fix: update tests to match new color palette MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update theme.test.ts to expect primary/secondary colors instead of blue/yellow/green - Update PrizeCard.test.tsx to expect beige-300 and primary-500 border classes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- __tests__/components/ui/PrizeCard.test.tsx | 6 +-- __tests__/utils/theme.test.ts | 56 +++++++++++----------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/__tests__/components/ui/PrizeCard.test.tsx b/__tests__/components/ui/PrizeCard.test.tsx index 6445ad7..68f93c8 100644 --- a/__tests__/components/ui/PrizeCard.test.tsx +++ b/__tests__/components/ui/PrizeCard.test.tsx @@ -45,15 +45,15 @@ describe('PrizeCard', () => { const { container } = render(); const card = container.firstChild; - expect(card).toHaveClass('border-[#e5e4dc]'); - expect(card).not.toHaveClass('border-[#d4a574]'); + expect(card).toHaveClass('border-beige-300'); + expect(card).not.toHaveClass('border-primary-500'); }); it('should render with grand prix styling when isGrandPrix is true', () => { const { container } = render(); const card = container.firstChild; - expect(card).toHaveClass('border-[#d4a574]'); + expect(card).toHaveClass('border-primary-500'); }); it('should apply custom className', () => { diff --git a/__tests__/utils/theme.test.ts b/__tests__/utils/theme.test.ts index c12e91a..ee13353 100644 --- a/__tests__/utils/theme.test.ts +++ b/__tests__/utils/theme.test.ts @@ -21,32 +21,32 @@ import { describe('Theme Utility', () => { describe('Constants', () => { it('should have all status colors defined', () => { - expect(STATUS_COLORS.PENDING).toBe('bg-yellow-100 text-yellow-800'); - expect(STATUS_COLORS.CLAIMED).toBe('bg-green-100 text-green-800'); + expect(STATUS_COLORS.PENDING).toBe('bg-secondary-100 text-secondary-800'); + expect(STATUS_COLORS.CLAIMED).toBe('bg-primary-100 text-primary-800'); expect(STATUS_COLORS.REJECTED).toBe('bg-red-100 text-red-800'); - expect(STATUS_COLORS.ACTIVE).toBe('bg-green-100 text-green-800'); + expect(STATUS_COLORS.ACTIVE).toBe('bg-primary-100 text-primary-800'); expect(STATUS_COLORS.INACTIVE).toBe('bg-gray-100 text-gray-800'); expect(STATUS_COLORS.EXPIRED).toBe('bg-red-100 text-red-800'); }); it('should have all badge colors defined', () => { expect(BADGE_COLORS.info).toBe('bg-blue-100 text-blue-800'); - expect(BADGE_COLORS.success).toBe('bg-green-100 text-green-800'); - expect(BADGE_COLORS.warning).toBe('bg-yellow-100 text-yellow-800'); + expect(BADGE_COLORS.success).toBe('bg-primary-100 text-primary-800'); + expect(BADGE_COLORS.warning).toBe('bg-secondary-100 text-secondary-800'); expect(BADGE_COLORS.error).toBe('bg-red-100 text-red-800'); expect(BADGE_COLORS.purple).toBe('bg-purple-100 text-purple-800'); expect(BADGE_COLORS.pink).toBe('bg-pink-100 text-pink-800'); - expect(BADGE_COLORS.amber).toBe('bg-amber-100 text-amber-800'); + expect(BADGE_COLORS.amber).toBe('bg-secondary-200 text-secondary-800'); expect(BADGE_COLORS.gray).toBe('bg-gray-100 text-gray-800'); }); it('should have all button styles defined', () => { - expect(BUTTON_STYLES.primary).toContain('bg-blue-600'); - expect(BUTTON_STYLES.secondary).toContain('bg-gray-600'); - expect(BUTTON_STYLES.success).toContain('bg-green-600'); + expect(BUTTON_STYLES.primary).toContain('bg-primary-500'); + expect(BUTTON_STYLES.secondary).toContain('bg-secondary-500'); + expect(BUTTON_STYLES.success).toContain('bg-primary-500'); expect(BUTTON_STYLES.danger).toContain('bg-red-600'); - expect(BUTTON_STYLES.warning).toContain('bg-yellow-600'); - expect(BUTTON_STYLES.outline).toContain('border-blue-600'); + expect(BUTTON_STYLES.warning).toContain('bg-secondary-400'); + expect(BUTTON_STYLES.outline).toContain('border-primary-500'); expect(BUTTON_STYLES.ghost).toContain('text-gray-600'); }); @@ -74,28 +74,28 @@ describe('Theme Utility', () => { it('should have role colors defined', () => { expect(ROLE_COLORS.ADMIN).toBe('bg-red-100 text-red-800'); expect(ROLE_COLORS.EMPLOYEE).toBe('bg-blue-100 text-blue-800'); - expect(ROLE_COLORS.CLIENT).toBe('bg-green-100 text-green-800'); + expect(ROLE_COLORS.CLIENT).toBe('bg-primary-100 text-primary-800'); }); it('should have prize colors defined', () => { expect(PRIZE_COLORS.INFUSEUR).toBe('bg-blue-100 text-blue-800'); - expect(PRIZE_COLORS.THE_SIGNATURE).toBe('bg-green-100 text-green-800'); + expect(PRIZE_COLORS.THE_SIGNATURE).toBe('bg-primary-100 text-primary-800'); expect(PRIZE_COLORS.COFFRET_DECOUVERTE).toBe('bg-purple-100 text-purple-800'); - expect(PRIZE_COLORS.COFFRET_PRESTIGE).toBe('bg-amber-100 text-amber-800'); + expect(PRIZE_COLORS.COFFRET_PRESTIGE).toBe('bg-secondary-200 text-secondary-800'); expect(PRIZE_COLORS.THE_GRATUIT).toBe('bg-pink-100 text-pink-800'); }); }); describe('getStatusColor', () => { it('should return correct color for known statuses', () => { - expect(getStatusColor('PENDING')).toBe('bg-yellow-100 text-yellow-800'); - expect(getStatusColor('CLAIMED')).toBe('bg-green-100 text-green-800'); + expect(getStatusColor('PENDING')).toBe('bg-secondary-100 text-secondary-800'); + expect(getStatusColor('CLAIMED')).toBe('bg-primary-100 text-primary-800'); expect(getStatusColor('REJECTED')).toBe('bg-red-100 text-red-800'); }); it('should handle lowercase statuses', () => { - expect(getStatusColor('pending')).toBe('bg-yellow-100 text-yellow-800'); - expect(getStatusColor('claimed')).toBe('bg-green-100 text-green-800'); + expect(getStatusColor('pending')).toBe('bg-secondary-100 text-secondary-800'); + expect(getStatusColor('claimed')).toBe('bg-primary-100 text-primary-800'); }); it('should return gray for unknown statuses', () => { @@ -106,16 +106,16 @@ describe('Theme Utility', () => { describe('getButtonStyle', () => { it('should return primary style by default', () => { - expect(getButtonStyle()).toContain('bg-blue-600'); + expect(getButtonStyle()).toContain('bg-primary-500'); }); it('should return correct style for variant', () => { - expect(getButtonStyle('primary')).toContain('bg-blue-600'); - expect(getButtonStyle('secondary')).toContain('bg-gray-600'); - expect(getButtonStyle('success')).toContain('bg-green-600'); + expect(getButtonStyle('primary')).toContain('bg-primary-500'); + expect(getButtonStyle('secondary')).toContain('bg-secondary-500'); + expect(getButtonStyle('success')).toContain('bg-primary-500'); expect(getButtonStyle('danger')).toContain('bg-red-600'); - expect(getButtonStyle('warning')).toContain('bg-yellow-600'); - expect(getButtonStyle('outline')).toContain('border-blue-600'); + expect(getButtonStyle('warning')).toContain('bg-secondary-400'); + expect(getButtonStyle('outline')).toContain('border-primary-500'); expect(getButtonStyle('ghost')).toContain('text-gray-600'); }); }); @@ -140,13 +140,13 @@ describe('Theme Utility', () => { it('should return correct color for known roles', () => { expect(getRoleColor('ADMIN')).toBe('bg-red-100 text-red-800'); expect(getRoleColor('EMPLOYEE')).toBe('bg-blue-100 text-blue-800'); - expect(getRoleColor('CLIENT')).toBe('bg-green-100 text-green-800'); + expect(getRoleColor('CLIENT')).toBe('bg-primary-100 text-primary-800'); }); it('should handle lowercase roles', () => { expect(getRoleColor('admin')).toBe('bg-red-100 text-red-800'); expect(getRoleColor('employee')).toBe('bg-blue-100 text-blue-800'); - expect(getRoleColor('client')).toBe('bg-green-100 text-green-800'); + expect(getRoleColor('client')).toBe('bg-primary-100 text-primary-800'); }); it('should return gray for unknown roles', () => { @@ -157,9 +157,9 @@ describe('Theme Utility', () => { describe('getPrizeColor', () => { it('should return correct color for known prize types', () => { expect(getPrizeColor('INFUSEUR')).toBe('bg-blue-100 text-blue-800'); - expect(getPrizeColor('THE_SIGNATURE')).toBe('bg-green-100 text-green-800'); + expect(getPrizeColor('THE_SIGNATURE')).toBe('bg-primary-100 text-primary-800'); expect(getPrizeColor('COFFRET_DECOUVERTE')).toBe('bg-purple-100 text-purple-800'); - expect(getPrizeColor('COFFRET_PRESTIGE')).toBe('bg-amber-100 text-amber-800'); + expect(getPrizeColor('COFFRET_PRESTIGE')).toBe('bg-secondary-200 text-secondary-800'); expect(getPrizeColor('THE_GRATUIT')).toBe('bg-pink-100 text-pink-800'); });