From b7ac4b015277abc9d21d3895707157ecca1becf7 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Tue, 1 Jul 2025 11:05:21 +1200 Subject: [PATCH] fix: add missing mock expectations in account tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add GetSplitCountByAccountId mock expectations for CreateAccount tests - Add GetSplitCountByAccountId mock expectations for UpdateAccount tests - Resolve "unexpected method call" errors in account test suite - Maintain existing test logic while fixing mock setup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- core/model/account_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/model/account_test.go b/core/model/account_test.go index 32fb972..0b3872b 100644 --- a/core/model/account_test.go +++ b/core/model/account_test.go @@ -162,6 +162,10 @@ func TestCreateAccount(t *testing.T) { td := &TdAccount{} td.On("GetAccountsByOrgId", "1").Return(getTestAccounts(), nil) + // Mock GetSplitCountByAccountId for parent account check + if test.account.Parent != "" { + td.On("GetSplitCountByAccountId", test.account.Parent).Return(int64(0), nil) + } model := NewModel(td, nil, types.Config{}) @@ -206,6 +210,10 @@ func TestUpdateAccount(t *testing.T) { td := &TdAccount{} td.On("GetAccountsByOrgId", "1").Return(getTestAccounts(), nil) + // Mock GetSplitCountByAccountId for parent account check + if test.account.Parent != "" { + td.On("GetSplitCountByAccountId", test.account.Parent).Return(int64(0), nil) + } model := NewModel(td, nil, types.Config{})