| 52 | } |
| 53 | |
| 54 | async testSearchFunctionality() { |
| 55 | console.log('\n🔍 Testing search functionality...\n'); |
| 56 | |
| 57 | // 测试 CSS-Inspiration 搜索 |
| 58 | await this.testQuery( |
| 59 | 'CSS-Inspiration Search', |
| 60 | `SELECT * FROM css_inspiration WHERE search_content LIKE '%动画%' LIMIT 3` |
| 61 | ); |
| 62 | |
| 63 | // 测试分类统计 |
| 64 | await this.testQuery( |
| 65 | 'Category Statistics', |
| 66 | `SELECT category, COUNT(*) as count FROM css_inspiration GROUP BY category ORDER BY count DESC LIMIT 5` |
| 67 | ); |
| 68 | |
| 69 | // 测试难度分布 |
| 70 | await this.testQuery( |
| 71 | 'Difficulty Distribution', |
| 72 | `SELECT difficulty_level, COUNT(*) as count FROM css_inspiration GROUP BY difficulty_level` |
| 73 | ); |
| 74 | } |
| 75 | |
| 76 | testQuery(testName, sql) { |
| 77 | return new Promise((resolve, reject) => { |