/* * Description: Static and helper regression tests for MXPIC EDA frontend/backend integration contracts. * Inside functions: N/A - assertion-based test/module script. * Developer : Qin Yue @ 2026 * Organization : OptiHK Limited */ const assert = require('assert'); const fs = require('fs'); const path = require('path'); const root = path.resolve(__dirname, '..'); const serverPy = fs.readFileSync(path.join(root, 'backend', 'server.py'), 'utf8'); const canvasHtml = fs.readFileSync(path.join(root, 'frontend', 'canvas.html'), 'utf8'); assert( serverPy.includes('EXPORT_ROOT'), 'server should build GDS exports into a temporary export root' ); assert( serverPy.includes("@app.route('/api/exports//'"), 'server should expose an authenticated export download route' ); assert( serverPy.includes('download_url'), 'Build GDS response should include download_url' ); assert( serverPy.includes('cleanup_expired_exports'), 'server should clean exports older than the retention period' ); assert( canvasHtml.includes('download_url'), 'frontend should read download_url from Build GDS response' ); assert( canvasHtml.includes('document.createElement') && canvasHtml.includes('.download'), 'frontend should trigger a browser download for generated GDS' );