test: fix unit tests for user_agent and proxy repo interface

- Add user_agent field to API contract test expectation
- Add ListWithFiltersAndAccountCount stub to proxyRepoStub
This commit is contained in:
Edric Li
2026-01-08 21:44:18 +08:00
parent b46b3c5c3c
commit 958ffe7a8a
2 changed files with 6 additions and 1 deletions

View File

@@ -243,7 +243,8 @@ func TestAPIContracts(t *testing.T) {
"first_token_ms": 50, "first_token_ms": 50,
"image_count": 0, "image_count": 0,
"image_size": null, "image_size": null,
"created_at": "2025-01-02T03:04:05Z" "created_at": "2025-01-02T03:04:05Z",
"user_agent": null
} }
], ],
"total": 1, "total": 1,

View File

@@ -186,6 +186,10 @@ func (s *proxyRepoStub) ListActiveWithAccountCount(ctx context.Context) ([]Proxy
panic("unexpected ListActiveWithAccountCount call") panic("unexpected ListActiveWithAccountCount call")
} }
func (s *proxyRepoStub) ListWithFiltersAndAccountCount(ctx context.Context, params pagination.PaginationParams, protocol, status, search string) ([]ProxyWithAccountCount, *pagination.PaginationResult, error) {
panic("unexpected ListWithFiltersAndAccountCount call")
}
func (s *proxyRepoStub) ExistsByHostPortAuth(ctx context.Context, host string, port int, username, password string) (bool, error) { func (s *proxyRepoStub) ExistsByHostPortAuth(ctx context.Context, host string, port int, username, password string) (bool, error) {
panic("unexpected ExistsByHostPortAuth call") panic("unexpected ExistsByHostPortAuth call")
} }