import { describe, expect, it } from 'vitest'; import { shortToolDescription, shortToolTitle } from './toolPresentation'; import type { ResolvedApp } from './types'; function app(id: string, name: string, description: string): ResolvedApp { return { id, name, description } as ResolvedApp; } describe('compact tool presentation', () => { it('uses the requested Audio & Video tile copy', () => { const audioVideo = app( 'de.add-ideas.av-tools', 'Audio & Video Tools', 'Convert and lightly edit audio and video locally in the browser.' ); expect(shortToolTitle(audioVideo)).toBe('Audio & Video'); expect(shortToolDescription(audioVideo)).toBe('Convert and edit locally.'); }); it('uses the requested Regex tile copy', () => { const regex = app( 'de.add-ideas.regex-tools', 'Regex Tools', 'Develop, explain, test and apply regular expressions locally in the browser.' ); expect(shortToolTitle(regex)).toBe('Regex'); expect(shortToolDescription(regex)).toBe('Explain and test locally.'); }); });