From 056d48c84c183f22c4313539e28393fa05cdc3e5 Mon Sep 17 00:00:00 2001 From: tauraamui Date: Thu, 25 Sep 2025 14:35:26 +0100 Subject: [PATCH] test(editor): add new model attached image support check inject --- internal/tui/components/chat/editor/editor_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/tui/components/chat/editor/editor_test.go b/internal/tui/components/chat/editor/editor_test.go index 4c0887039bf8aeb0a2e86697042ec6670aeca245..bf64afb6e89066b6144dca57f9379d76a823b542 100644 --- a/internal/tui/components/chat/editor/editor_test.go +++ b/internal/tui/components/chat/editor/editor_test.go @@ -336,8 +336,11 @@ func TestEditor_OnPastePathToImageEmitsAttachFileMessage(t *testing.T) { err = os.Chdir(tempDir) require.NoError(t, err) + modelHasImageSupport := func() (bool, string) { + return true, "TestModel" + } absRef := filepath.Abs - _, cmd := onPaste(absRef, testEditor, tea.PasteMsg("image.png")) + _, cmd := onPaste(absRef, modelHasImageSupport, testEditor, tea.PasteMsg("image.png")) require.NotNil(t, cmd) msg := cmd() @@ -387,7 +390,10 @@ func TestEditor_OnPastePathToNonImageEmitsAttachFileMessage(t *testing.T) { err = os.Chdir(tempDir) require.NoError(t, err) - _, cmd := onPaste(filepath.Abs, testEditor, tea.PasteMsg("random.txt")) + modelHasImageSupport := func() (bool, string) { + return true, "TestModel" + } + _, cmd := onPaste(filepath.Abs, modelHasImageSupport, testEditor, tea.PasteMsg("random.txt")) assert.Nil(t, cmd) }