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

test(native): clean synthetic legacy stock fixture before activation

davoodmehraban89 committed Oct 31, 2026 at 22:27 UTC f437f243f6a85873be835b54380210ca5a7150e1
1 file changed +9 -1
tests/windows-vm-native-functional-matrix.cjs
+9 -1
@@ -67,10 +67,18 @@ async function legacyStockAdjustmentFormAndValidation() {
67 await FINORA.Modal.close();
68 check(!document.querySelector('.toast-error'),
69 'Legacy stock adjustment form displayed an unexpected error');
70 + // Remove only this scenario's synthetic legacy movement and product. The
71 + // following activation scenario deliberately refuses any pre-existing
72 + // stock movement, so the disposable fixture must leave the company empty.
73 + await FINORA.Storage.delete('stock_movements', movement.id);
74 + await FINORA.Storage.delete('products', product.id);
75 + check(!(await FINORA.Storage.getAll('stock_movements')).some(move => move.productId === product.id) &&
76 + !(await FINORA.Storage.getAll('products')).some(row => row.id === product.id),
77 + 'Synthetic legacy stock-adjustment fixture cleanup failed');
78 return { overPrecisionRejectedWithoutWrites: true,
79 negativeRejectedWithoutWrites: true, validAdjustmentPosted: true,
80 fractionalQuantityPreserved: true, parentKardexRefreshedInPlace: true,
73 - duplicateKardexPrevented: true };
81 + duplicateKardexPrevented: true, syntheticFixtureCleanedBeforeActivation: true };
82 }
83
84 async function integratedStockAdjustmentGuard() {