#!/usr/bin/env node /** * Simple test script to verify Block Tester UX consistency fixes * Tests the key functionality without requiring full app compilation */ import * as fs from 'fs'; import * as path from 'path'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const PROJECT_ROOT = path.join(__dirname, '..'); const BLOCK_TESTER_ROOT = path.join(PROJECT_ROOT, 'src/renderer/components/tools/block-tester'); interface TestResult { name: string; passed: boolean; message: string; } const results: TestResult[] = []; function addResult(name: string, passed: boolean, message: string): void { results.push({ name, passed, message }); console.log(`${passed ? 'āœ…' : 'āŒ'} ${name}: ${message}`); } function readFile(filePath: string): string { try { return fs.readFileSync(filePath, 'utf-8'); } catch (error) { throw new Error(`Could not read file: ${filePath}`); } } function testHeaderRemoval(): void { const layoutPath = path.join(BLOCK_TESTER_ROOT, 'BlockTesterLayout.tsx'); const content = readFile(layoutPath); const hasCustomHeader = content.includes('bg-gradient-to-r from-hgo-blue via-hgo-purple to-hgo-green'); const hasHeaderElement = content.includes('
{ console.log('🧪 Testing Block Tester UX Consistency Fixes...\n'); try { testHeaderRemoval(); testCardFlattening(); testThemeIntegration(); testCSPFixes(); testFileStructure(); testViewSwitchFunctionality(); console.log('\nšŸ“Š Test Results:'); const passed = results.filter(r => r.passed).length; const total = results.length; console.log(`āœ… Passed: ${passed}/${total}`); if (passed === total) { console.log('\nšŸŽ‰ All Block Tester UX consistency fixes successfully implemented!'); console.log('\n✨ Key improvements:'); console.log(' • Removed jarring custom header'); console.log(' • Flattened excessive card nesting'); console.log(' • Fixed Monaco Editor CSP violations'); console.log(' • Integrated with desktop theme system'); console.log(' • Replaced CDN dependencies with inline CSS'); console.log(' • Clean view switching controls'); } else { console.log(`\nāš ļø ${total - passed} tests failed. Review implementation.`); process.exit(1); } } catch (error) { console.error('āŒ Test execution failed:', error.message); process.exit(1); } } runTests();