import { bambuLabColors, colorsByFinish, getColorHex, getColorsForFinish } from '@/src/data/bambuLabColorsComplete';

describe('Bambu Lab Colors Complete Data', () => {
  it('should have color definitions', () => {
    expect(bambuLabColors).toBeDefined();
    expect(typeof bambuLabColors).toBe('object');
    expect(Object.keys(bambuLabColors).length).toBeGreaterThan(0);
  });

  it('should have basic colors', () => {
    expect(bambuLabColors).toHaveProperty('Black');
    expect(bambuLabColors).toHaveProperty('White');
    expect(bambuLabColors).toHaveProperty('Red');
    expect(bambuLabColors).toHaveProperty('Blue');
  });

  it('should have matte colors', () => {
    expect(bambuLabColors).toHaveProperty('Matte Ivory White');
    expect(bambuLabColors).toHaveProperty('Matte Charcoal');
    expect(bambuLabColors).toHaveProperty('Matte Scarlet Red');
  });

  it('should have silk colors', () => {
    expect(bambuLabColors).toHaveProperty('Silk Aurora Purple');
    expect(bambuLabColors).toHaveProperty('Silk Phantom Blue');
    expect(bambuLabColors).toHaveProperty('Silk Mystic Magenta');
  });

  it('should have valid hex colors', () => {
    Object.entries(bambuLabColors).forEach(([colorName, hex]) => {
      expect(hex).toMatch(/^#[0-9A-Fa-f]{6}$/);
    });
  });

  it('should have colorsByFinish defined', () => {
    expect(colorsByFinish).toBeDefined();
    expect(typeof colorsByFinish).toBe('object');
  });

  it('should have finish categories', () => {
    expect(colorsByFinish).toHaveProperty('Basic');
    expect(colorsByFinish).toHaveProperty('Matte');
    expect(colorsByFinish).toHaveProperty('Silk+');
    expect(colorsByFinish).toHaveProperty('Metal');
    expect(colorsByFinish).toHaveProperty('Sparkle');
    expect(colorsByFinish).toHaveProperty('Glow');
    expect(colorsByFinish).toHaveProperty('Translucent');
    expect(colorsByFinish).toHaveProperty('CF');
  });

  it('should return valid hex for getColorHex', () => {
    const hex = getColorHex('Black');
    expect(hex).toBe('#000000');
    
    const unknownHex = getColorHex('Unknown Color');
    expect(unknownHex).toBe('#000000');
  });

  it('should return colors for finish', () => {
    const basicColors = getColorsForFinish('Basic');
    expect(Array.isArray(basicColors)).toBe(true);
    expect(basicColors.length).toBeGreaterThan(0);
    
    const unknownFinish = getColorsForFinish('Unknown');
    expect(Array.isArray(unknownFinish)).toBe(true);
    expect(unknownFinish.length).toBe(0);
  });
});