fix: add missing mock expectations in account tests

- 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 <noreply@anthropic.com>
This commit is contained in:
2025-07-01 11:05:21 +12:00
parent 1b115fe0ff
commit b7ac4b0152

View File

@@ -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{})