سامانه صدور فاکتور و حسابداری
test: distinguish completed one-time legacy compatibility migration from no-write invoice search
davoodmehraban89 committed
Oct 15, 2026 at 21:47 UTC
91141c49cf5e964747a049f756d827493dd3bd11
1 file changed
+5
-7
scripts/pages-artifact.spec.js
+5
-7
@@ -201,7 +201,10 @@ test('Published Pages F0-02 invoice product and buyer search only use synthetic
201
];
202
datastore.settings=[{
203
ownerUserId:currentUser.id,default_company_id:'QA_CO',
204
- currency_mode:'rial',vat_mode:'none',vat_rate:10
204
+ currency_mode:'rial',vat_mode:'none',vat_rate:10,
205
+ // Production accounts with completed one-time compatibility migration
206
+ // do not rewrite their settings merely when a contact list is rendered.
207
+ accountingFoundationMigrationV2_QA_CO:{completedAt:'2026-01-01T00:00:00Z',mode:'copy-preserve-ids'}
208
}];
209
datastore.products=[
210
{id:'QA_B10',ownerUserId:currentUser.id,name:'بلوک سیمانی سبک',
@@ -222,8 +225,7 @@ test('Published Pages F0-02 invoice product and buyer search only use synthetic
225
datastore.invoices=[];
226
window.__qaBackupSaveDatastore=saveDatastore;
227
window.__qaSaveCalls=0;
225
- window.__qaSaveStacks=[];
226
- saveDatastore=()=>{window.__qaSaveCalls++;window.__qaSaveStacks.push(new Error('CAPTURED_SAVE_CALL').stack||'unknown')};
228
+ saveDatastore=()=>{window.__qaSaveCalls++;throw Error('SYNTHETIC_FILTER_UNEXPECTED_SAVE')};
229
document.getElementById('invoice-items-table-body').replaceChildren();
230
renderContacts();
231
addInvoiceItemRow();
@@ -266,10 +268,6 @@ test('Published Pages F0-02 invoice product and buyer search only use synthetic
268
productSelection:document.querySelector('#invoice-items-table-body .row-product-select')?.value||'',
269
buyerSelection:document.getElementById('invoice-contact-id')?.value||''
270
}));
269
- if(unchanged.saveCalls){
270
- const stacks=await page.evaluate(()=>window.__qaSaveStacks||[]);
271
- console.log('F0-02 unexpected synthetic save invocation stacks:',JSON.stringify(stacks));
272
- }
271
expect(unchanged).toEqual({saveCalls:0,invoiceCount:0,productSelection:'',buyerSelection:originalBuyer});
272
expect(errors).toEqual([]);
273
});