MovieMapper/tests/legacy/test-implementation.js
Jarian Cottingham 1a35eb346e chore: reorganize repo layout, remove dead files
- Move phase/plan docs into docs/
- Move legacy node:test files into tests/legacy/ with README
- Remove .backup file, test audit artifacts, and unused AI prompt/skill files
- Remove broken iOS GitHub workflows (reference missing MovieMapper-iOS/)
2026-08-20 20:11:57 +00:00

57 lines
2.6 KiB
JavaScript

const { test } = require('node:test');
const assert = require('assert');
// Test the core functionality of the implemented features
test('Audit system is properly implemented', () => {
// Verify all required components exist in main.js
const fs = require('fs');
const mainJsContent = fs.readFileSync('./main.js', 'utf8');
// Check for audit logging functions
assert.ok(mainJsContent.includes('function writeAuditLog'), 'writeAuditLog function should exist');
assert.ok(mainJsContent.includes('ipcMain.handle(\'log-audit-event\''), 'log-audit-event handler should exist');
assert.ok(mainJsContent.includes('commandLineDirectory = process.argv.find'), 'Command line parsing should exist');
assert.ok(mainJsContent.includes('const auditFileName = \'.audit\''), 'Audit file naming logic should exist');
console.log('✅ All audit system components verified');
});
test('Visual enhancements are implemented', () => {
// Check that the HTML/CSS changes are in place
const fs = require('fs');
const htmlContent = fs.readFileSync('./index.html', 'utf8');
// Check for the circle styling (60px as defined in CSS)
assert.ok(htmlContent.includes('width: 60px'), 'Circle width should be 60px');
assert.ok(htmlContent.includes('height: 60px'), 'Circle height should be 60px');
assert.ok(htmlContent.includes('background-color: #e94560'), 'Circle should be red');
assert.ok(htmlContent.includes('color: white'), 'Circle text should be white');
console.log('✅ All visual enhancements verified');
});
test('Command line parameters work', () => {
// Verify that the system can parse directory parameters
const fs = require('fs');
const mainJsContent = fs.readFileSync('./main.js', 'utf8');
assert.ok(mainJsContent.includes('--dir=') || mainJsContent.includes('-d='), 'Directory parameter parsing should be implemented');
console.log('✅ Command line parameter parsing verified');
});
test('File movement handles behind-the-scenes folder', () => {
// Verify that behind-the-scenes is a valid folder name
const fs = require('fs');
const mainJsContent = fs.readFileSync('./main.js', 'utf8');
// Check that behind-the-scenes is in valid folders
assert.ok(mainJsContent.includes("'behind-the-scenes'"), 'behind-the-scenes should be in valid folders');
// Check that it maps to "behind the scenes" (with space)
assert.ok(mainJsContent.includes("actualFolderName = 'behind the scenes'"), 'Should map to "behind the scenes"');
console.log('✅ File movement handles behind-the-scenes folder correctly');
});
console.log('All tests completed successfully!');