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

test(A04): pin backup version to package, Tauri and DB metadata

davoodmehraban89 committed Oct 14, 2026 at 22:33 UTC a484a6d6596d1bf9cf215b7e044b6d0b5a92e34e
1 file changed +12
tests/backup-restore-integration.test.mjs
+12
@@ -1,3 +1,5 @@
1 +import appPackage from '../package.json' with { type: 'json' };
2 +import { readFileSync } from 'node:fs';
3 import test from 'node:test';
4 import assert from 'node:assert/strict';
5 import 'fake-indexeddb/auto';
@@ -124,3 +126,13 @@ test('A04: a unique-index conflict rolls back the entire full-snapshot transacti
126 assert.equal((await StorageService.get('products', 'baseline')).name, 'Existing');
127 assert.equal((await StorageService.getAll('journal_entries')).length, 0);
128 });
129 +
130 +test('A04: exported appVersion, package and desktop installer versions agree', async () => {
131 + await setup();
132 + const backup = await SettingsController.exportBackup();
133 + const desktop = JSON.parse(readFileSync(new URL('../src-tauri/tauri.conf.json', import.meta.url), 'utf8'));
134 + assert.equal(backup.version, appPackage.version);
135 + assert.equal(backup.appVersion, appPackage.version);
136 + assert.equal(desktop.version, appPackage.version);
137 + assert.equal(backup.schemaVersion, (await StorageService.exportAll()).version);
138 +});