import { describe, expect, it } from 'vitest';

import { isLocalIcon, loadIconCollection } from './index';

describe('offline icon collections', () => {
  it('keeps common icons in the startup registry', () => {
    expect(isLocalIcon('mdi:github')).toBe(true);
    expect(isLocalIcon('ant-design:appstore-outlined')).toBe(true);
  });

  it('loads uncommon icons from a bundled collection on demand', async () => {
    expect(isLocalIcon('mdi:ab-testing')).toBe(false);

    await loadIconCollection('mdi');

    expect(isLocalIcon('mdi:ab-testing')).toBe(true);
  });
});
