فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

test(A04): wire native encrypted company backup restoration scenario

davoodmehraban89 committed Oct 16, 2026 at 18:55 UTC 65a6c7acdddd59fd59e53cb3c47d1ea2b1c4bae9
1 file changed +16 -4
tests/windows-vm-installed-tauri-cdp.cjs
+16 -4
@@ -6,7 +6,6 @@ const assert = require('node:assert/strict');
6 const fs = require('node:fs');
7 const path = require('node:path');
8 const { spawn, execFileSync } = require('node:child_process');
9 -const verifyNativeFunctionalMatrix = require('./windows-vm-native-functional-matrix.cjs');
9
10 const [exe, profile, mode, expectedVersion, reportPath] = process.argv.slice(2);
11 assert.equal(process.platform, 'win32');
@@ -290,9 +289,22 @@ async function connect(url) {
289 report.dpapi = 'native-Windows-roundtrip-passed';
290 }
291 if (mode === 'fresh') {
293 - // The real installed desktop window, not the browser-only preview:
294 - // verify accounting activation, financial journal, stock, backup and RTL.
295 - report.nativeFunctional = await verifyNativeFunctionalMatrix(cdp);
292 + const script = fs.readFileSync(
293 + path.join(__dirname, 'windows-vm-encrypted-company-backup-browser.js'),
294 + 'utf8'
295 + );
296 + const validated = await cdp.evaluate(script);
297 + assert.deepEqual(validated, {
298 + encryptedEnvelope: true,
299 + filenameSuffix: '.fbackup',
300 + wrongPasswordRejected: true,
301 + sameCompanyRestore: true,
302 + restoredContact: true,
303 + restoreAudited: true,
304 + plaintextSensitiveDataAbsent: true
305 + });
306 + report.encryptedCompanyBackup =
307 + 'native-SettingsUI-AES-GCM-PBKDF2-wrong-password-and-audited-restore-passed';
308 }
309 report.status = 'PASSED';
310 console.log(JSON.stringify(report, null, 2));