Repository navigation
test(presentation): swap hand-written test stubs for committed counterfeiter fakes - #1924
Merged
Merged
Conversation
…unterfeiter fakes Delete stubModeState, stubStatusView, stubInputView, stubHelpBar and mockModelService, and wire agentdomainmocks, tuimocks and conversationmocks fakes instead. PermanentSwitch now asserts SelectModelArgsForCall instead of reading the stub's currentModel field.
inference-gateway-maintainer
Bot
marked this pull request as ready for review
November 20, 2026 14:59
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
November 20, 2026 14:59
5 tasks
Contributor
|
🎉 This PR is included in version 0.265.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1920
Summary
Swaps the remaining hand-written test doubles for the counterfeiter fakes that are already committed under
tests/mocks/, per the Testing rule in AGENTS.md. The embedded-interface stubs inapplication_view_test.gowould have panicked on any method they did not override, and the hand-rolledmockModelServiceduplicated fiveconvdomain.ModelServicemethods outside the generated source of truth. Test-only change: no production code, no new counterfeiter line inTaskfile.yml, and no regenerated mocks.Changes
internal/presentation/tui/components/application_view_test.go: deletedstubModeState,stubStatusView,stubInputViewandstubHelpBar. The mode indicator now readsagentdomainmocks.FakeAgentModeStateviaGetAgentModeReturns, and the row/composer tests passtuimocks.FakeStatusComponent(RenderReturns),tuimocks.FakeInputComponentandtuimocks.FakeHelpBarComponent.internal/presentation/shortcuts/model_test.go: deletedmockModelServiceand its five methods. The tests useconversationmocks.FakeModelServicethroughGetCurrentModelReturnsandValidateModelReturns, and the permanent-switch test now assertsSelectModelCallCountplusSelectModelArgsForCall(0)instead of reading the stub'scurrentModelfield.internal/presentation/shortcuts/core_test.goandeffort_test.go: these same-package tests shared the deletedmockModelService, so they now useconvmocks.FakeModelService/conversationmocks.FakeModelServicewithGetCurrentModelReturnsas well. This extends the diff beyond the two files named in the issue; the package would not otherwise compile.agentdomainmocks,tuimocksandconversationmocksaliases.stubTokenEstimatorincore_test.goandstubShortcutinnoninteractive_test.gohave no committed counterpart fake, so swapping them needs new mock generation or an external test package first.Verification
task precommit:runpasses (mod tidy, mocks up to date, fmt, import alias lint, golangci-lint 0 issues, markdownlint).go test ./internal/presentation/shortcuts/... ./internal/presentation/tui/components/...passes.no docs ticket: test-only refactor with no user-facing behavior change.