summaryrefslogtreecommitdiff
path: root/internal/gui/generator_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-06 11:06:19 +0300
committerPaul Buetow <paul@buetow.org>2026-04-06 11:06:19 +0300
commit05f54cc0cb8cf3535698ab5027d200842bdb28e3 (patch)
tree30b7e778be29db63301119b7cfa8be5a5edc041e /internal/gui/generator_test.go
parent23160bce9a18a70080a85dda6e9c654499aba7f7 (diff)
refactor: consolidate provider factory test seams into shared named types
Define audio.ProviderFactory, image.PromptAwareClient, image.OpenAIClientFactory, image.NanoBananaClientFactory, and image.ClientFactories as the single source of truth for the three injectable factory signatures that were previously duplicated across processor.Processor, gui.Application, and gui.GenerationOrchestrator. Replace all three separate function-type fields with imageFactories image.ClientFactories + newAudioProvider audio.ProviderFactory, eliminating the parallel field declarations and the local promptAwareImageClient interface in gui/generator.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/gui/generator_test.go')
-rw-r--r--internal/gui/generator_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/gui/generator_test.go b/internal/gui/generator_test.go
index c8bcf42..40c0e2c 100644
--- a/internal/gui/generator_test.go
+++ b/internal/gui/generator_test.go
@@ -107,7 +107,7 @@ func TestGenerateImagesWithPromptUsesNanoBananaProvider(t *testing.T) {
},
currentWord: "друго",
}
- app.newNanoBananaImageClient = func(config *image.NanoBananaConfig) promptAwareImageClient {
+ app.imageFactories.NewNanoBananaClient = func(config *image.NanoBananaConfig) image.PromptAwareClient {
capturedConfig = &image.NanoBananaConfig{
APIKey: config.APIKey,
Model: config.Model,
@@ -115,7 +115,7 @@ func TestGenerateImagesWithPromptUsesNanoBananaProvider(t *testing.T) {
}
return fakeClient
}
- app.newOpenAIImageClient = func(*image.OpenAIConfig) promptAwareImageClient {
+ app.imageFactories.NewOpenAIClient = func(*image.OpenAIConfig) image.PromptAwareClient {
t.Fatal("unexpected OpenAI image client construction")
return nil
}