Class_generator/tests/ai-validation/test-spanish-bug.js
StillHammer f5cef0c913 Add comprehensive testing suite with UI/UX and E2E integration tests
- Create complete integration test system (test-integration.js)
- Add UI/UX interaction testing with real event simulation (test-uiux-integration.js)
- Implement end-to-end scenario testing for user journeys (test-e2e-scenarios.js)
- Add console testing commands for rapid development testing (test-console-commands.js)
- Create comprehensive test guide documentation (TEST-GUIDE.md)
- Integrate test buttons in debug panel (F12 → 3 test types)
- Add vocabulary modal two-progress-bar system integration
- Fix flashcard retry system for "don't know" cards
- Update IntelligentSequencer for task distribution validation

🧪 Testing Coverage:
- 35+ integration tests (architecture/modules)
- 20+ UI/UX tests (real user interactions)
- 5 E2E scenarios (complete user journeys)
- Console commands for rapid testing
- Debug panel integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-28 23:04:38 +08:00

79 lines
2.6 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Test spécifique du bug de traduction espagnole
import { default as IAEngine } from './src/DRS/services/IAEngine.js';
async function testSpanishBug() {
console.log('🐛 TEST SPÉCIFIQUE - Bug traduction espagnole\n');
const engine = new IAEngine({
defaultProvider: 'openai',
fallbackProviders: ['deepseek']
});
await new Promise(resolve => setTimeout(resolve, 1000));
console.log('Testing "What time is it?" -> "¿Qué hora es?" 5 times...\n');
const results = [];
for (let i = 1; i <= 5; i++) {
try {
console.log(`Round ${i}/5:`);
const result = await engine.validateTranslation(
'What time is it?',
'¿Qué hora es?',
{
fromLang: 'en',
toLang: 'es',
testRound: i,
timestamp: Date.now()
}
);
console.log(` Score: ${result.score}`);
console.log(` Provider: ${result.provider}`);
console.log(` Feedback: ${result.feedback?.substring(0, 100)}...`);
results.push({
round: i,
score: result.score,
provider: result.provider,
feedback: result.feedback
});
} catch (error) {
console.log(` ❌ Error: ${error.message}`);
results.push({
round: i,
score: 'ERROR',
error: error.message
});
}
await new Promise(resolve => setTimeout(resolve, 4000));
console.log('');
}
console.log('📊 ANALYSE DU BUG:');
console.log('=================\n');
const validScores = results.filter(r => typeof r.score === 'number').map(r => r.score);
console.log('Scores obtenus:', validScores);
console.log(`Moyenne: ${validScores.length > 0 ? Math.round(validScores.reduce((a,b) => a+b, 0) / validScores.length) : 'N/A'}`);
console.log(`Min-Max: ${Math.min(...validScores)}-${Math.max(...validScores)}`);
console.log(`Tous à 0: ${validScores.every(s => s === 0) ? 'OUI' : 'NON'}`);
if (validScores.every(s => s === 0)) {
console.log('\n🐛 BUG CONFIRMÉ:');
console.log('✅ Reproductible à 100%');
console.log('❌ Traduction correcte espagnole = 0 points');
console.log('🔧 Besoin de debug le prompt de traduction');
} else {
console.log('\n⚠ VARIANCE DÉTECTÉE:');
console.log('Le scoring n\'est pas constant');
}
return results;
}
testSpanishBug().catch(console.error);