test(transactions): update shared-flags and query-count baselines for splits

- InertiaSharedDataTest: the shared feature flags now include transactionSplitting
- performance thresholds: +1 query on the transactions list and cashflow
  breakdown for the splits eager-load (a single bulk query, does not scale)
This commit is contained in:
Víctor Falcón 2026-07-19 15:06:35 +02:00
parent 18d61b8e77
commit 6e33f7942b
3 changed files with 8 additions and 4 deletions

View File

@ -100,6 +100,7 @@ test('shared feature flags do not include coinbase flag', function () {
'cashflow' => true,
'calculateBalancesOnImport' => false,
'mcp' => false,
'transactionSplitting' => false,
]);
});

View File

@ -78,7 +78,8 @@ test('cashflow trend API does not exceed query threshold', function () {
});
test('cashflow breakdown API does not exceed query threshold', function () {
assertMaxQueries(15, function () {
// +1 vs. pre-split: the breakdown eager-loads each transaction's splits.
assertMaxQueries(16, function () {
$this->getJson("/api/cashflow/breakdown?type=expense&{$this->dateParams}")->assertOk();
}, 'API Cashflow Breakdown');
});

View File

@ -57,7 +57,8 @@ test('account show page does not exceed query threshold', function () {
});
test('transactions index page does not exceed query threshold', function () {
assertMaxQueries(21, function () {
// +1 vs. pre-split: the list eager-loads each transaction's splits.
assertMaxQueries(22, function () {
$this->get(route('transactions.index'))->assertOk();
}, 'Transactions Index');
});
@ -163,8 +164,9 @@ test('transactions page query count does not scale with number of transactions',
'category_id' => $category->id,
]);
// Same threshold — paginated queries should not scale
assertMaxQueries(21, function () {
// Same threshold as the base case — the splits eager-load is a single bulk
// query, so it stays constant regardless of how many transactions there are.
assertMaxQueries(22, function () {
$this->get(route('transactions.index'))->assertOk();
}, 'Transactions with 120 records');
});