import {
  AssetPaths,
  getImagePath,
  getLogoPath,
  getIconPath,
  Images,
  Logos,
  Icons,
} from '@/lib/assets';

describe('AssetPaths constants', () => {
  it('has the correct images base path', () => {
    expect(AssetPaths.images).toBe('/assets/images');
  });

  it('has the correct logos base path', () => {
    expect(AssetPaths.logos).toBe('/assets/logos');
  });

  it('has the correct icons base path', () => {
    expect(AssetPaths.icons).toBe('/assets/icons');
  });
});

describe('getImagePath', () => {
  it('returns the correct full path for a given filename', () => {
    expect(getImagePath('hero-banner.jpg')).toBe('/assets/images/hero-banner.jpg');
  });

  it('handles filenames without extension', () => {
    expect(getImagePath('background')).toBe('/assets/images/background');
  });

  it('handles filenames with multiple dots', () => {
    expect(getImagePath('my.image.v2.png')).toBe('/assets/images/my.image.v2.png');
  });

  it('starts with a slash', () => {
    expect(getImagePath('test.jpg')).toMatch(/^\//);
  });
});

describe('getLogoPath', () => {
  it('returns the correct full path for a logo', () => {
    expect(getLogoPath('xpeditis-logo.svg')).toBe('/assets/logos/xpeditis-logo.svg');
  });

  it('handles a dark variant logo', () => {
    expect(getLogoPath('xpeditis-logo-dark.svg')).toBe('/assets/logos/xpeditis-logo-dark.svg');
  });

  it('starts with a slash', () => {
    expect(getLogoPath('icon.svg')).toMatch(/^\//);
  });
});

describe('getIconPath', () => {
  it('returns the correct full path for an icon', () => {
    expect(getIconPath('shipping-icon.svg')).toBe('/assets/icons/shipping-icon.svg');
  });

  it('handles a PNG icon', () => {
    expect(getIconPath('notification.png')).toBe('/assets/icons/notification.png');
  });

  it('starts with a slash', () => {
    expect(getIconPath('arrow.svg')).toMatch(/^\//);
  });
});

describe('pre-defined asset collections', () => {
  it('Images is a defined object', () => {
    expect(Images).toBeDefined();
    expect(typeof Images).toBe('object');
  });

  it('Logos is a defined object', () => {
    expect(Logos).toBeDefined();
    expect(typeof Logos).toBe('object');
  });

  it('Icons is a defined object', () => {
    expect(Icons).toBeDefined();
    expect(typeof Icons).toBe('object');
  });
});
