@@ -59,7 +59,7 @@ const assumptions = {
|
||||
periods: 12,
|
||||
};
|
||||
|
||||
test('financial forecast reconciles revenue, finance sources, working capital and monthly cash', () => {
|
||||
void test('financial forecast reconciles revenue, finance sources, working capital and monthly cash', () => {
|
||||
const result = forecastBusinessPlan(assumptions);
|
||||
assert.equal(result.workingCapital, '25000.00');
|
||||
assert.equal(result.initialUses, '125000.00');
|
||||
@@ -90,7 +90,7 @@ test('financial forecast reconciles revenue, finance sources, working capital an
|
||||
assert.equal(result.endingCash, '113000.00');
|
||||
});
|
||||
|
||||
test('opening payable installments reduce cash without changing profit and retain unpaid balances', () => {
|
||||
void test('opening payable installments reduce cash without changing profit and retain unpaid balances', () => {
|
||||
const opening = {
|
||||
...assumptions,
|
||||
periods: 3,
|
||||
@@ -171,7 +171,7 @@ test('opening payable installments reduce cash without changing profit and retai
|
||||
);
|
||||
});
|
||||
|
||||
test('opening payable schedule caps cent rounding at the remaining balance', () => {
|
||||
void test('opening payable schedule caps cent rounding at the remaining balance', () => {
|
||||
const rounded = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
periods: 2,
|
||||
@@ -213,7 +213,7 @@ test('opening payable schedule caps cent rounding at the remaining balance', ()
|
||||
assert.equal(rounded.openingPayablesAtEnd, '0.00');
|
||||
});
|
||||
|
||||
test('monthly unit schedules drive revenue, costs, inventory and scenario volume', () => {
|
||||
void test('monthly unit schedules drive revenue, costs, inventory and scenario volume', () => {
|
||||
const seasonal = {
|
||||
...assumptions,
|
||||
periods: 3,
|
||||
@@ -286,7 +286,7 @@ test('monthly unit schedules drive revenue, costs, inventory and scenario volume
|
||||
);
|
||||
});
|
||||
|
||||
test('monthly unit schedules must match the horizon and contain valid quantities', () => {
|
||||
void test('monthly unit schedules must match the horizon and contain valid quantities', () => {
|
||||
assert.throws(
|
||||
() =>
|
||||
forecastBusinessPlan({
|
||||
@@ -331,7 +331,7 @@ test('monthly unit schedules must match the horizon and contain valid quantities
|
||||
);
|
||||
});
|
||||
|
||||
test('monthly prices and unit costs affect revenue, consumption and scenarios', () => {
|
||||
void test('monthly prices and unit costs affect revenue, consumption and scenarios', () => {
|
||||
const plan = {
|
||||
...assumptions,
|
||||
periods: 3,
|
||||
@@ -385,7 +385,7 @@ test('monthly prices and unit costs affect revenue, consumption and scenarios',
|
||||
);
|
||||
});
|
||||
|
||||
test('monthly money schedules cover the horizon and reject invalid amounts', () => {
|
||||
void test('monthly money schedules cover the horizon and reject invalid amounts', () => {
|
||||
assert.throws(
|
||||
() =>
|
||||
forecastBusinessPlan({
|
||||
@@ -430,7 +430,7 @@ test('monthly money schedules cover the horizon and reject invalid amounts', ()
|
||||
);
|
||||
});
|
||||
|
||||
test('monthly operating and payroll expense schedules remain separate from payments', () => {
|
||||
void test('monthly operating and payroll expense schedules remain separate from payments', () => {
|
||||
const result = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
periods: 3,
|
||||
@@ -486,7 +486,7 @@ test('monthly operating and payroll expense schedules remain separate from payme
|
||||
assert.equal(scenarios.favorable.result.rows[0].payrollExpense, '450.00');
|
||||
});
|
||||
|
||||
test('monthly operating schedules require full horizon, exact cents and current snapshot version', () => {
|
||||
void test('monthly operating schedules require full horizon, exact cents and current snapshot version', () => {
|
||||
assert.throws(
|
||||
() =>
|
||||
forecastBusinessPlan({
|
||||
@@ -546,7 +546,7 @@ test('monthly operating schedules require full horizon, exact cents and current
|
||||
assert.match(csv, /Pagamentos de pessoal/);
|
||||
});
|
||||
|
||||
test('losses and negative closing cash remain visible instead of being clamped to zero', () => {
|
||||
void test('losses and negative closing cash remain visible instead of being clamped to zero', () => {
|
||||
const result = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
openingCash: '-100',
|
||||
@@ -569,7 +569,7 @@ test('losses and negative closing cash remain visible instead of being clamped t
|
||||
assert.ok(Number(result.endingCash) < 0);
|
||||
});
|
||||
|
||||
test('principal repayments affect cash but are excluded from profit expenses', () => {
|
||||
void test('principal repayments affect cash but are excluded from profit expenses', () => {
|
||||
const withPrincipal = forecastBusinessPlan(assumptions);
|
||||
const withoutPrincipal = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
@@ -586,7 +586,7 @@ test('principal repayments affect cash but are excluded from profit expenses', (
|
||||
);
|
||||
});
|
||||
|
||||
test('depreciation allocation reconciles exactly over useful life', () => {
|
||||
void test('depreciation allocation reconciles exactly over useful life', () => {
|
||||
const result = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
assetDepreciation: '100.00',
|
||||
@@ -599,7 +599,7 @@ test('depreciation allocation reconciles exactly over useful life', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('missing currency, products, invalid numbers and invalid horizons are explicit errors', () => {
|
||||
void test('missing currency, products, invalid numbers and invalid horizons are explicit errors', () => {
|
||||
assert.throws(
|
||||
() => forecastBusinessPlan({ ...assumptions, currency: '' }),
|
||||
/moeda ISO/,
|
||||
@@ -643,7 +643,7 @@ test('missing currency, products, invalid numbers and invalid horizons are expli
|
||||
);
|
||||
});
|
||||
|
||||
test('versioned plan snapshots restore assumptions and reject unsupported or oversized data', () => {
|
||||
void test('versioned plan snapshots restore assumptions and reject unsupported or oversized data', () => {
|
||||
const saved = serializeBusinessPlanSnapshot(assumptions);
|
||||
assert.deepEqual(restoreBusinessPlanSnapshot(saved), assumptions);
|
||||
assert.equal(
|
||||
@@ -976,7 +976,7 @@ test('versioned plan snapshots restore assumptions and reject unsupported or ove
|
||||
);
|
||||
});
|
||||
|
||||
test('business plan serializer refuses snapshots above the server storage limit', () => {
|
||||
void test('business plan serializer refuses snapshots above the server storage limit', () => {
|
||||
assert.throws(
|
||||
() =>
|
||||
serializeBusinessPlanSnapshot({
|
||||
@@ -992,7 +992,7 @@ test('business plan serializer refuses snapshots above the server storage limit'
|
||||
);
|
||||
});
|
||||
|
||||
test('sales invoicing and receipts follow an optional declared collection lag', () => {
|
||||
void test('sales invoicing and receipts follow an optional declared collection lag', () => {
|
||||
const delayed = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
monthlyCollections: '0',
|
||||
@@ -1024,7 +1024,7 @@ test('sales invoicing and receipts follow an optional declared collection lag',
|
||||
assert.equal(sameMonth.totalProfitBeforeTax, delayed.totalProfitBeforeTax);
|
||||
});
|
||||
|
||||
test('scheduled collection percentage keeps unpaid invoices in receivables with exact rounding', () => {
|
||||
void test('scheduled collection percentage keeps unpaid invoices in receivables with exact rounding', () => {
|
||||
const partial = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
monthlyCollections: '0',
|
||||
@@ -1071,7 +1071,7 @@ test('scheduled collection percentage keeps unpaid invoices in receivables with
|
||||
);
|
||||
});
|
||||
|
||||
test('sales recovery applies only to overdue invoices and never exceeds open balances', () => {
|
||||
void test('sales recovery applies only to overdue invoices and never exceeds open balances', () => {
|
||||
const recovered = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
monthlyCollections: '0',
|
||||
@@ -1142,7 +1142,7 @@ test('sales recovery applies only to overdue invoices and never exceeds open bal
|
||||
);
|
||||
});
|
||||
|
||||
test('opening receivables affect cash only when a month and collection percentage are declared', () => {
|
||||
void test('opening receivables affect cash only when a month and collection percentage are declared', () => {
|
||||
const unscheduled = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
monthlyCollections: '0',
|
||||
@@ -1190,7 +1190,7 @@ test('opening receivables affect cash only when a month and collection percentag
|
||||
);
|
||||
});
|
||||
|
||||
test('opening receivable installments reconcile to the initial balance across months', () => {
|
||||
void test('opening receivable installments reconcile to the initial balance across months', () => {
|
||||
const scheduled = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
monthlyCollections: '0',
|
||||
@@ -1263,7 +1263,7 @@ test('opening receivable installments reconcile to the initial balance across mo
|
||||
);
|
||||
});
|
||||
|
||||
test('opening receivable installments cap independently rounded cents at the available balance', () => {
|
||||
void test('opening receivable installments cap independently rounded cents at the available balance', () => {
|
||||
const rounded = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
receivables: '0.01',
|
||||
@@ -1280,7 +1280,7 @@ test('opening receivable installments cap independently rounded cents at the ava
|
||||
assert.equal(rounded.openingReceivablesAtEnd, '0.00');
|
||||
});
|
||||
|
||||
test('inventory purchases, consumption, closing stock and stock shortfall reconcile independently of payments', () => {
|
||||
void test('inventory purchases, consumption, closing stock and stock shortfall reconcile independently of payments', () => {
|
||||
const supplied = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
inventory: '0',
|
||||
@@ -1302,7 +1302,7 @@ test('inventory purchases, consumption, closing stock and stock shortfall reconc
|
||||
assert.equal(supplied.rows[0].variableCostPayments, '0.00');
|
||||
});
|
||||
|
||||
test('inventory lead time separates monthly orders, receipts, shortages and goods still in transit', () => {
|
||||
void test('inventory lead time separates monthly orders, receipts, shortages and goods still in transit', () => {
|
||||
const result = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
inventory: '0',
|
||||
@@ -1333,7 +1333,7 @@ test('inventory lead time separates monthly orders, receipts, shortages and good
|
||||
assert.equal(result.endingCash, noDelay.endingCash);
|
||||
});
|
||||
|
||||
test('monthly inventory purchase schedule reconciles variable orders, lead times, receipts and transit', () => {
|
||||
void test('monthly inventory purchase schedule reconciles variable orders, lead times, receipts and transit', () => {
|
||||
const result = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
periods: 4,
|
||||
@@ -1436,7 +1436,7 @@ test('monthly inventory purchase schedule reconciles variable orders, lead times
|
||||
assert.match(csv, /Prazo da encomenda \(meses\)/);
|
||||
});
|
||||
|
||||
test('monthly variable purchase payments affect cash independently from inventory orders and profit', () => {
|
||||
void test('monthly variable purchase payments affect cash independently from inventory orders and profit', () => {
|
||||
const base = {
|
||||
...assumptions,
|
||||
periods: 3,
|
||||
@@ -1464,7 +1464,7 @@ test('monthly variable purchase payments affect cash independently from inventor
|
||||
);
|
||||
});
|
||||
|
||||
test('product inventory schedules reconcile independently and do not transfer stock between products', () => {
|
||||
void test('product inventory schedules reconcile independently and do not transfer stock between products', () => {
|
||||
const plan = {
|
||||
...assumptions,
|
||||
periods: 2,
|
||||
@@ -1542,7 +1542,7 @@ test('product inventory schedules reconcile independently and do not transfer st
|
||||
);
|
||||
});
|
||||
|
||||
test('supplier payment terms drive purchase cash flow and expose amounts due beyond the horizon', () => {
|
||||
void test('supplier payment terms drive purchase cash flow and expose amounts due beyond the horizon', () => {
|
||||
const plan = {
|
||||
...assumptions,
|
||||
periods: 2,
|
||||
@@ -1624,7 +1624,7 @@ test('supplier payment terms drive purchase cash flow and expose amounts due bey
|
||||
);
|
||||
});
|
||||
|
||||
test('supplier order installments reconcile exact cents, cash dates and unallocated balances', () => {
|
||||
void test('supplier order installments reconcile exact cents, cash dates and unallocated balances', () => {
|
||||
const plan = {
|
||||
...assumptions,
|
||||
periods: 2,
|
||||
@@ -1691,7 +1691,7 @@ test('supplier order installments reconcile exact cents, cash dates and unalloca
|
||||
assert.equal(restoreBusinessPlanSnapshot(JSON.stringify(snapshot)), null);
|
||||
});
|
||||
|
||||
test('business assumptions survive the existing encrypted-draft snapshot split and restore', () => {
|
||||
void test('business assumptions survive the existing encrypted-draft snapshot split and restore', () => {
|
||||
const encoded = serializeBusinessPlanSnapshot(assumptions);
|
||||
const snapshots = partitionSimulationDraft({
|
||||
purpose: 'own_investment',
|
||||
@@ -1709,7 +1709,7 @@ test('business assumptions survive the existing encrypted-draft snapshot split a
|
||||
);
|
||||
});
|
||||
|
||||
test('presentation currency conversion requires and reports its rate, date, and declared source', () => {
|
||||
void test('presentation currency conversion requires and reports its rate, date, and declared source', () => {
|
||||
const result = forecastBusinessPlan({
|
||||
...assumptions,
|
||||
presentationCurrency: 'USD',
|
||||
@@ -1760,7 +1760,7 @@ test('presentation currency conversion requires and reports its rate, date, and
|
||||
);
|
||||
});
|
||||
|
||||
test('CSV marks presentation currency conversion as an unverified user planning assumption', () => {
|
||||
void test('CSV marks presentation currency conversion as an unverified user planning assumption', () => {
|
||||
const csv = exportBusinessPlanCsv(
|
||||
{
|
||||
...assumptions,
|
||||
@@ -1779,7 +1779,7 @@ test('CSV marks presentation currency conversion as an unverified user planning
|
||||
);
|
||||
});
|
||||
|
||||
test('business plan export carries its assumptions, formulas, period, currency, and matching result', () => {
|
||||
void test('business plan export carries its assumptions, formulas, period, currency, and matching result', () => {
|
||||
const csv = exportBusinessPlanCsv(
|
||||
{ ...assumptions, periods: 1 },
|
||||
'2026-10-02T10:00:00.000Z',
|
||||
@@ -1805,7 +1805,7 @@ test('business plan export carries its assumptions, formulas, period, currency,
|
||||
assert.match(csv, /Existências em trânsito no fim do horizonte,0\.00/);
|
||||
});
|
||||
|
||||
test('business plan CSV preserves declared monthly product schedules', () => {
|
||||
void test('business plan CSV preserves declared monthly product schedules', () => {
|
||||
const csv = exportBusinessPlanCsv(
|
||||
{
|
||||
...assumptions,
|
||||
@@ -1826,7 +1826,7 @@ test('business plan CSV preserves declared monthly product schedules', () => {
|
||||
assert.ok(csv.includes('"[""40"",""55"",""30"",""20""]"'));
|
||||
});
|
||||
|
||||
test('CSV export exposes the sales collection assumption and outstanding receivable', () => {
|
||||
void test('CSV export exposes the sales collection assumption and outstanding receivable', () => {
|
||||
const csv = exportBusinessPlanCsv(
|
||||
{
|
||||
...assumptions,
|
||||
@@ -1849,7 +1849,7 @@ test('CSV export exposes the sales collection assumption and outstanding receiva
|
||||
);
|
||||
});
|
||||
|
||||
test('business plan CSV neutralizes formula-like labels and preserves negative financial values', () => {
|
||||
void test('business plan CSV neutralizes formula-like labels and preserves negative financial values', () => {
|
||||
const csv = exportBusinessPlanCsv({
|
||||
...assumptions,
|
||||
products: [
|
||||
@@ -1865,7 +1865,7 @@ test('business plan CSV neutralizes formula-like labels and preserves negative f
|
||||
assert.match(csv, /Diferença entre usos e fontes,-5000\.00/);
|
||||
});
|
||||
|
||||
test('financial scenarios expose user-declared changes without creating tax values', () => {
|
||||
void test('financial scenarios expose user-declared changes without creating tax values', () => {
|
||||
const scenarioPlan = {
|
||||
...assumptions,
|
||||
periods: 1,
|
||||
|
||||
Reference in New Issue
Block a user