mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 21:46:35 +00:00
feat: add tool popularity and icons
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user