From bf1c88bc1b042ee8d6a84ae8521f52239c3deddc Mon Sep 17 00:00:00 2001 From: tauraamui Date: Wed, 17 Sep 2025 12:15:47 +0100 Subject: [PATCH] fix(lint): appease missed linter issues --- .../tui/components/chat/editor/editor_test.go | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/internal/tui/components/chat/editor/editor_test.go b/internal/tui/components/chat/editor/editor_test.go index b9140d44985beac64f932df5b139f65f25bc8448..2a39cb4f0f3e1fee49ecb1610dd0e834fcc92c32 100644 --- a/internal/tui/components/chat/editor/editor_test.go +++ b/internal/tui/components/chat/editor/editor_test.go @@ -205,7 +205,7 @@ func TestEditorAutoCompletion_OnNonImageFileFullPathInsertedFromQuery(t *testing keyPressMsg = tea.KeyPressMsg{ Text: "t", } - m, msg = simulateUpdate(testEditor, keyPressMsg) + m, _ = simulateUpdate(testEditor, keyPressMsg) testEditor = m.(*editorCmp) selectMsg := completions.SelectCompletionMsg{ @@ -236,8 +236,7 @@ func TestEditor_OnCompletionPathToImageEmitsAttachFileMessage(t *testing.T) { }, } testEditor := newEditor(&app.App{}, entriesForAutoComplete) - model, cmd := onCompletionItemSelect(fsys, FileCompletionItem{Path: "auto_completed_image.png"}, true, testEditor) - testEditor = model.(*editorCmp) + _, cmd := onCompletionItemSelect(fsys, FileCompletionItem{Path: "auto_completed_image.png"}, true, testEditor) require.NotNil(t, cmd) msg := cmd() @@ -267,8 +266,7 @@ func TestEditor_OnCompletionPathToNonImageEmitsAttachFileMessage(t *testing.T) { }, } testEditor := newEditor(&app.App{}, entriesForAutoComplete) - model, cmd := onCompletionItemSelect(fsys, FileCompletionItem{Path: "random.txt"}, true, testEditor) - testEditor = model.(*editorCmp) + _, cmd := onCompletionItemSelect(fsys, FileCompletionItem{Path: "random.txt"}, true, testEditor) assert.Nil(t, cmd) } @@ -284,8 +282,7 @@ func TestEditor_OnPastePathToImageEmitsAttachFileMessage(t *testing.T) { }, } testEditor := newEditor(&app.App{}, entriesForAutoComplete) - model, cmd := onPaste(fsys, mockResolveAbs, testEditor, tea.PasteMsg("image.png")) - testEditor = model.(*editorCmp) + _, cmd := onPaste(fsys, mockResolveAbs, testEditor, tea.PasteMsg("image.png")) require.NotNil(t, cmd) msg := cmd() @@ -315,8 +312,7 @@ func TestEditor_OnPastePathToNonImageEmitsAttachFileMessage(t *testing.T) { }, } testEditor := newEditor(&app.App{}, entriesForAutoComplete) - model, cmd := onPaste(fsys, mockResolveAbs, testEditor, tea.PasteMsg("random.txt")) - testEditor = model.(*editorCmp) + _, cmd := onPaste(fsys, mockResolveAbs, testEditor, tea.PasteMsg("random.txt")) assert.Nil(t, cmd) } @@ -332,8 +328,7 @@ func TestHelperFunctions(t *testing.T) { Text: "/", } - m, cmds := testEditor.Update(keyPressMsg) - testEditor = m.(*editorCmp) + _, cmds := testEditor.Update(keyPressMsg) // Execute the command and check if it returns a BatchMsg msg := cmds()