Files
Void-Homelab/tests/health/registry.test.js
2026-06-02 22:52:46 +10:00

18 lines
734 B
JavaScript

import { describe, it, expect } from 'vitest';
import { load, grouped, iconSlug, CATEGORY_ORDER } from '../../lib/health/registry.js';
describe('registry', () => {
it('loads the seed config', () => { expect(load().length).toBeGreaterThan(0); });
it('derives an icon slug from icon or name', () => {
expect(iconSlug({ name: 'Open WebUI' })).toBe('open-webui');
expect(iconSlug({ name: 'Plex', icon: 'plex' })).toBe('plex');
});
it('groups in agents→infrastructure→media order', () => {
const g = grouped(load());
const cats = g.map(x => x.category);
const ai = cats.indexOf('agents'), mi = cats.indexOf('media');
expect(ai).toBeLessThan(mi);
expect(CATEGORY_ORDER[0]).toBe('agents');
});
});