From fb4fc275cbbafde50650e947090a6d973ea8ae60 Mon Sep 17 00:00:00 2001 From: tauraamui Date: Tue, 23 Sep 2025 10:47:02 +0100 Subject: [PATCH] test(fix): make expected path also be expanded to absolute path --- internal/tui/components/chat/editor/editor_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/tui/components/chat/editor/editor_test.go b/internal/tui/components/chat/editor/editor_test.go index 0a51cc4deca92942af8e0b8df4a02602ba6b63da..3f6c79b838f897991fb251da2191faf3f816aadc 100644 --- a/internal/tui/components/chat/editor/editor_test.go +++ b/internal/tui/components/chat/editor/editor_test.go @@ -298,7 +298,8 @@ func TestEditor_OnPastePathToImageEmitsAttachFileMessage(t *testing.T) { err = os.Chdir(tempDir) require.NoError(t, err) - _, cmd := onPaste(filepath.Abs, testEditor, tea.PasteMsg("image.png")) + absRef := filepath.Abs + _, cmd := onPaste(absRef, testEditor, tea.PasteMsg("image.png")) require.NotNil(t, cmd) msg := cmd() @@ -309,8 +310,10 @@ func TestEditor_OnPastePathToImageEmitsAttachFileMessage(t *testing.T) { attachmentMsg = fpickedMsg.Attachment } + absImagePath, err := absRef(imagePath) + assert.NoError(t, err) assert.Equal(t, message.Attachment{ - FilePath: imagePath, + FilePath: absImagePath, FileName: "image.png", MimeType: "image/png", Content: pngMagicNumberData,