diff --git a/tests/Feature/InertiaSharedDataTest.php b/tests/Feature/InertiaSharedDataTest.php index 02a7d293..a96fdcd1 100644 --- a/tests/Feature/InertiaSharedDataTest.php +++ b/tests/Feature/InertiaSharedDataTest.php @@ -100,6 +100,7 @@ test('shared feature flags do not include coinbase flag', function () { 'cashflow' => true, 'calculateBalancesOnImport' => false, 'mcp' => false, + 'transactionSplitting' => false, ]); }); diff --git a/tests/Performance/ApiQueryCountTest.php b/tests/Performance/ApiQueryCountTest.php index 5416d506..3aedc19d 100644 --- a/tests/Performance/ApiQueryCountTest.php +++ b/tests/Performance/ApiQueryCountTest.php @@ -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'); }); diff --git a/tests/Performance/PageQueryCountTest.php b/tests/Performance/PageQueryCountTest.php index abc16d39..675c3721 100644 --- a/tests/Performance/PageQueryCountTest.php +++ b/tests/Performance/PageQueryCountTest.php @@ -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'); });