feat: add tool popularity and icons

This commit is contained in:
2026-08-24 09:16:29 +05:00
parent 68476c3b8c
commit 76f1770286
7 changed files with 189 additions and 0 deletions
+16
View File
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest';
import { CATEGORIES } from './categories';
import { TOOL_ICONS } from './tools/tool-icons';
import {
defaultParams,
getTool,
@@ -150,6 +151,21 @@ describe('реестр инструментов', () => {
const resize = getToolOrThrow('resize-png');
expect(defaultParams(resize)).toEqual({ width: 0, height: 0, keepAspect: true });
});
it('словарь иконок покрывает все инструменты', () => {
for (const tool of TOOLS) {
expect(TOOL_ICONS[tool.id]).toBeDefined();
}
});
it('у каждого инструмента популярность в диапазоне 0..100 и ключ иконки', () => {
for (const tool of TOOLS) {
expect(tool.popularity).toBeGreaterThanOrEqual(0);
expect(tool.popularity).toBeLessThanOrEqual(100);
expect(typeof tool.icon).toBe('string');
expect(tool.icon!.length).toBeGreaterThan(0);
}
});
});
describe('sanitizeParams', () => {