import { OriginUIService } from '../src/originui-service.js';
async function testTabsSearch() {
console.log('š Testing Tabs Component Search...\n');
const service = new OriginUIService();
// Test 1: Search for "tabs"
console.log('š Test 1: Search for "tabs"');
try {
const result = await service.searchComponents('tabs', undefined, 10);
console.log('ā
Search successful!');
console.log(result.content[0].text);
} catch (error) {
console.log('ā Search failed:', error);
}
console.log('\nš Test 2: Search in navigation category');
try {
const result = await service.searchComponents('tabs', 'navigation', 5);
console.log('ā
Category search successful!');
console.log(result.content[0].text);
} catch (error) {
console.log('ā Category search failed:', error);
}
console.log('\nš Test 3: Get screenshot for tabs component');
try {
const result = await service.getComponentScreenshot('tabs', 'both');
console.log('ā
Screenshot test successful!');
console.log('Content items:', result.content.length);
result.content.forEach((item, index) => {
if (item.type === 'text') {
console.log(`${index + 1}. TEXT: ${item.text?.substring(0, 100)}...`);
} else if (item.type === 'image') {
console.log(`${index + 1}. IMAGE: ${item.image_url}`);
}
});
} catch (error) {
console.log('ā Screenshot test failed:', error);
}
console.log('\nš Tabs component testing complete!');
}
testTabsSearch().catch(console.error);