فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test: initialize browser compatibility before importing report controller
davoodmehraban89 committed
Nov 1, 2026 at 06:11 UTC
8473220424c955450009d0f996289d10f8aef5c6
1 file changed
+2
-1
tests/report-zero-discount-integrity.test.mjs
+2
-1
@@ -4,7 +4,6 @@ import 'fake-indexeddb/auto';
4
import { StorageService } from '../src/core/StorageService.js';
5
import { CompanyService } from '../src/core/CompanyService.js';
6
import { Auth } from '../src/core/Auth.js';
7
-import { ReportController } from '../src/controllers/ReportController.js';
7
import { reportLineRevenue } from '../src/core/ReportLineRevenue.mjs';
8
9
const companyId='synthetic-zero-discount-report-company';
@@ -50,6 +49,8 @@ test('real indexedDB sales and profitability reports preserve discounted zero an
49
{productId:'report-product',productName:'Synthetic product',qty:2,price:100}
50
]
51
});
52
+ globalThis.window ??= globalThis;
53
+ const { ReportController } = await import('../src/controllers/ReportController.js');
54
const analysis=await ReportController.getSalesAnalysis({preset:'all'});
55
assert.equal(analysis.topProductsBySales[0].totalSales,260);
56
assert.equal(analysis.topProductsBySales[0].qty,5);