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

test(backup): prevent silent duplicate ID overwrite

davoodmehraban89 committed Oct 14, 2026 at 11:14 UTC 5c15b05249a65fa3778d5eb06ce8b7bac674a683
1 file changed +11
tests/backup-record-id-validation.test.mjs
+11
@@ -25,3 +25,14 @@ test('backup import rejects array-valued records', async () => {
25 /رکورد نامعتبر/
26 );
27 });
28 +
29 +test('backup import rejects duplicate IDs without opening the database', async () => {
30 + await assert.rejects(
31 + StorageService.importAll({
32 + app: 'Factor-easyPro',
33 + version: 6,
34 + data: { products: [{ id: 'same' }, { id: 'same' }] }
35 + }),
36 + /شناسه تکراری/
37 + );
38 +});