You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(api/federation): register mock.AssertExpectations on federationHandler() mock #44
federationHandler() in internal/api/handler_federation_test.go creates a MockAuthService with a single ValidateSession stub but never registers t.Cleanup(func() { mockAuth.AssertExpectations(t) }). All 40+ federation tests that call federationHandler() inherit this gap.
Per the project feedback rule (feedback_mock_assert_expectations.md): every mock must have AssertExpectations registered via t.Cleanup so unmatched On stubs are caught as test failures rather than silently passing.
Fix
Refactor federationHandler() to accept a *testing.T parameter, register t.Cleanup(func() { mockAuth.AssertExpectations(t) }) inside it, and update all call sites. Since the same mockAuth is used for every federation test, this one change covers the entire file.
Activity