fix: update tests to match new color palette
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
81a3e0bfae
commit
41313a2477
|
|
@ -45,15 +45,15 @@ describe('PrizeCard', () => {
|
||||||
const { container } = render(<PrizeCard {...defaultProps} />);
|
const { container } = render(<PrizeCard {...defaultProps} />);
|
||||||
|
|
||||||
const card = container.firstChild;
|
const card = container.firstChild;
|
||||||
expect(card).toHaveClass('border-[#e5e4dc]');
|
expect(card).toHaveClass('border-beige-300');
|
||||||
expect(card).not.toHaveClass('border-[#d4a574]');
|
expect(card).not.toHaveClass('border-primary-500');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render with grand prix styling when isGrandPrix is true', () => {
|
it('should render with grand prix styling when isGrandPrix is true', () => {
|
||||||
const { container } = render(<PrizeCard {...defaultProps} isGrandPrix />);
|
const { container } = render(<PrizeCard {...defaultProps} isGrandPrix />);
|
||||||
|
|
||||||
const card = container.firstChild;
|
const card = container.firstChild;
|
||||||
expect(card).toHaveClass('border-[#d4a574]');
|
expect(card).toHaveClass('border-primary-500');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should apply custom className', () => {
|
it('should apply custom className', () => {
|
||||||
|
|
|
||||||
|
|
@ -21,32 +21,32 @@ import {
|
||||||
describe('Theme Utility', () => {
|
describe('Theme Utility', () => {
|
||||||
describe('Constants', () => {
|
describe('Constants', () => {
|
||||||
it('should have all status colors defined', () => {
|
it('should have all status colors defined', () => {
|
||||||
expect(STATUS_COLORS.PENDING).toBe('bg-yellow-100 text-yellow-800');
|
expect(STATUS_COLORS.PENDING).toBe('bg-secondary-100 text-secondary-800');
|
||||||
expect(STATUS_COLORS.CLAIMED).toBe('bg-green-100 text-green-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.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.INACTIVE).toBe('bg-gray-100 text-gray-800');
|
||||||
expect(STATUS_COLORS.EXPIRED).toBe('bg-red-100 text-red-800');
|
expect(STATUS_COLORS.EXPIRED).toBe('bg-red-100 text-red-800');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have all badge colors defined', () => {
|
it('should have all badge colors defined', () => {
|
||||||
expect(BADGE_COLORS.info).toBe('bg-blue-100 text-blue-800');
|
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.success).toBe('bg-primary-100 text-primary-800');
|
||||||
expect(BADGE_COLORS.warning).toBe('bg-yellow-100 text-yellow-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.error).toBe('bg-red-100 text-red-800');
|
||||||
expect(BADGE_COLORS.purple).toBe('bg-purple-100 text-purple-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.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');
|
expect(BADGE_COLORS.gray).toBe('bg-gray-100 text-gray-800');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have all button styles defined', () => {
|
it('should have all button styles defined', () => {
|
||||||
expect(BUTTON_STYLES.primary).toContain('bg-blue-600');
|
expect(BUTTON_STYLES.primary).toContain('bg-primary-500');
|
||||||
expect(BUTTON_STYLES.secondary).toContain('bg-gray-600');
|
expect(BUTTON_STYLES.secondary).toContain('bg-secondary-500');
|
||||||
expect(BUTTON_STYLES.success).toContain('bg-green-600');
|
expect(BUTTON_STYLES.success).toContain('bg-primary-500');
|
||||||
expect(BUTTON_STYLES.danger).toContain('bg-red-600');
|
expect(BUTTON_STYLES.danger).toContain('bg-red-600');
|
||||||
expect(BUTTON_STYLES.warning).toContain('bg-yellow-600');
|
expect(BUTTON_STYLES.warning).toContain('bg-secondary-400');
|
||||||
expect(BUTTON_STYLES.outline).toContain('border-blue-600');
|
expect(BUTTON_STYLES.outline).toContain('border-primary-500');
|
||||||
expect(BUTTON_STYLES.ghost).toContain('text-gray-600');
|
expect(BUTTON_STYLES.ghost).toContain('text-gray-600');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -74,28 +74,28 @@ describe('Theme Utility', () => {
|
||||||
it('should have role colors defined', () => {
|
it('should have role colors defined', () => {
|
||||||
expect(ROLE_COLORS.ADMIN).toBe('bg-red-100 text-red-800');
|
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.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', () => {
|
it('should have prize colors defined', () => {
|
||||||
expect(PRIZE_COLORS.INFUSEUR).toBe('bg-blue-100 text-blue-800');
|
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_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');
|
expect(PRIZE_COLORS.THE_GRATUIT).toBe('bg-pink-100 text-pink-800');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getStatusColor', () => {
|
describe('getStatusColor', () => {
|
||||||
it('should return correct color for known statuses', () => {
|
it('should return correct color for known statuses', () => {
|
||||||
expect(getStatusColor('PENDING')).toBe('bg-yellow-100 text-yellow-800');
|
expect(getStatusColor('PENDING')).toBe('bg-secondary-100 text-secondary-800');
|
||||||
expect(getStatusColor('CLAIMED')).toBe('bg-green-100 text-green-800');
|
expect(getStatusColor('CLAIMED')).toBe('bg-primary-100 text-primary-800');
|
||||||
expect(getStatusColor('REJECTED')).toBe('bg-red-100 text-red-800');
|
expect(getStatusColor('REJECTED')).toBe('bg-red-100 text-red-800');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle lowercase statuses', () => {
|
it('should handle lowercase statuses', () => {
|
||||||
expect(getStatusColor('pending')).toBe('bg-yellow-100 text-yellow-800');
|
expect(getStatusColor('pending')).toBe('bg-secondary-100 text-secondary-800');
|
||||||
expect(getStatusColor('claimed')).toBe('bg-green-100 text-green-800');
|
expect(getStatusColor('claimed')).toBe('bg-primary-100 text-primary-800');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return gray for unknown statuses', () => {
|
it('should return gray for unknown statuses', () => {
|
||||||
|
|
@ -106,16 +106,16 @@ describe('Theme Utility', () => {
|
||||||
|
|
||||||
describe('getButtonStyle', () => {
|
describe('getButtonStyle', () => {
|
||||||
it('should return primary style by default', () => {
|
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', () => {
|
it('should return correct style for variant', () => {
|
||||||
expect(getButtonStyle('primary')).toContain('bg-blue-600');
|
expect(getButtonStyle('primary')).toContain('bg-primary-500');
|
||||||
expect(getButtonStyle('secondary')).toContain('bg-gray-600');
|
expect(getButtonStyle('secondary')).toContain('bg-secondary-500');
|
||||||
expect(getButtonStyle('success')).toContain('bg-green-600');
|
expect(getButtonStyle('success')).toContain('bg-primary-500');
|
||||||
expect(getButtonStyle('danger')).toContain('bg-red-600');
|
expect(getButtonStyle('danger')).toContain('bg-red-600');
|
||||||
expect(getButtonStyle('warning')).toContain('bg-yellow-600');
|
expect(getButtonStyle('warning')).toContain('bg-secondary-400');
|
||||||
expect(getButtonStyle('outline')).toContain('border-blue-600');
|
expect(getButtonStyle('outline')).toContain('border-primary-500');
|
||||||
expect(getButtonStyle('ghost')).toContain('text-gray-600');
|
expect(getButtonStyle('ghost')).toContain('text-gray-600');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -140,13 +140,13 @@ describe('Theme Utility', () => {
|
||||||
it('should return correct color for known roles', () => {
|
it('should return correct color for known roles', () => {
|
||||||
expect(getRoleColor('ADMIN')).toBe('bg-red-100 text-red-800');
|
expect(getRoleColor('ADMIN')).toBe('bg-red-100 text-red-800');
|
||||||
expect(getRoleColor('EMPLOYEE')).toBe('bg-blue-100 text-blue-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', () => {
|
it('should handle lowercase roles', () => {
|
||||||
expect(getRoleColor('admin')).toBe('bg-red-100 text-red-800');
|
expect(getRoleColor('admin')).toBe('bg-red-100 text-red-800');
|
||||||
expect(getRoleColor('employee')).toBe('bg-blue-100 text-blue-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', () => {
|
it('should return gray for unknown roles', () => {
|
||||||
|
|
@ -157,9 +157,9 @@ describe('Theme Utility', () => {
|
||||||
describe('getPrizeColor', () => {
|
describe('getPrizeColor', () => {
|
||||||
it('should return correct color for known prize types', () => {
|
it('should return correct color for known prize types', () => {
|
||||||
expect(getPrizeColor('INFUSEUR')).toBe('bg-blue-100 text-blue-800');
|
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_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');
|
expect(getPrizeColor('THE_GRATUIT')).toBe('bg-pink-100 text-pink-800');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user