- Add intermediate saves (v1.0-v1.4) to Generated_Articles_Versioned - Fix compiled_text pipeline (generatedTexts object structure) - Add /api/workflow-modulaire endpoint with version tracking - Create test-modulaire.html interface with real-time logs - Support parent-child linking via Parent_Article_ID
128 lines
3.8 KiB
JavaScript
128 lines
3.8 KiB
JavaScript
// ========================================
|
|
// TESTS GÉNÉRÉS AUTOMATIQUEMENT - ManualTrigger
|
|
// Module: ManualTrigger.js
|
|
// Générés le: 2025-09-06T03:38:47.977Z
|
|
// ========================================
|
|
|
|
const assert = require('assert');
|
|
const { test, describe } = require('node:test');
|
|
const ManualTrigger = require('../../ManualTrigger.js');
|
|
|
|
describe('ManualTrigger - Tests automatiques', () => {
|
|
|
|
// Setup avant les tests
|
|
let testContext = {};
|
|
|
|
test('Module loading', () => {
|
|
assert.ok(ManualTrigger, 'Module should be loaded');
|
|
console.log('📦 Module ManualTrigger loaded successfully');
|
|
});
|
|
|
|
|
|
test('runWorkflowLigne - Basic Function', () => {
|
|
const input = "test_value";
|
|
|
|
try {
|
|
const result = ManualTrigger.runWorkflowLigne(input);
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(typeof result !== 'undefined', 'Result should be defined');
|
|
|
|
console.log('✅ runWorkflowLigne: Function executed successfully');
|
|
|
|
} catch (error) {
|
|
console.error('❌ runWorkflowLigne: Function failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('readCSVDataFromRow - Basic Function', () => {
|
|
const input = "test_value";
|
|
|
|
try {
|
|
const result = ManualTrigger.readCSVDataFromRow(input);
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(typeof result !== 'undefined', 'Result should be defined');
|
|
|
|
console.log('✅ readCSVDataFromRow: Function executed successfully');
|
|
|
|
} catch (error) {
|
|
console.error('❌ readCSVDataFromRow: Function failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('getXMLTemplateForTest - Basic Function', () => {
|
|
const input = { mc0: "test keyword", t0: "Test title" };
|
|
|
|
try {
|
|
const result = ManualTrigger.getXMLTemplateForTest(input);
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(typeof result !== 'undefined', 'Result should be defined');
|
|
|
|
console.log('✅ getXMLTemplateForTest: Function executed successfully');
|
|
|
|
} catch (error) {
|
|
console.error('❌ getXMLTemplateForTest: Function failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('if - Basic Function', () => {
|
|
const input = undefined;
|
|
|
|
try {
|
|
const result = ManualTrigger.if(input);
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(typeof result !== 'undefined', 'Result should be defined');
|
|
|
|
console.log('✅ if: Function executed successfully');
|
|
|
|
} catch (error) {
|
|
console.error('❌ if: Function failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
test('catch - Basic Function', () => {
|
|
const input = undefined;
|
|
|
|
try {
|
|
const result = ManualTrigger.catch(input);
|
|
|
|
// Validations de base
|
|
assert.ok(result !== undefined, 'Should return a result');
|
|
assert.ok(typeof result !== 'undefined', 'Result should be defined');
|
|
|
|
console.log('✅ catch: Function executed successfully');
|
|
|
|
} catch (error) {
|
|
console.error('❌ catch: Function failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
|
|
|
|
// Test d'intégration général
|
|
test('Integration - Module health check', async () => {
|
|
try {
|
|
// Vérification exports
|
|
const exports = Object.keys(ManualTrigger);
|
|
assert.ok(exports.length > 0, 'Module should export functions');
|
|
|
|
console.log(`✅ ManualTrigger: ${exports.length} exports available`);
|
|
console.log('📋 Exports:', exports.join(', '));
|
|
|
|
} catch (error) {
|
|
console.error('❌ Integration test failed:', error.message);
|
|
throw error;
|
|
}
|
|
});
|
|
}); |