Skip to content

Commit fa7dfbf

Browse files
committed
fix: Add check for clipboard state
1 parent cf05608 commit fa7dfbf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/internal/handle_file_operation_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ func TestPasteItem(t *testing.T) {
255255
} else {
256256
verifySuccessfulPasteResults(t, tt.targetDir, tt.expectedDestFiles, originalPath, tt.shouldOriginalExist)
257257
}
258+
// Checking separately, as this is something independent of tt.shouldPreventPaste
259+
if tt.shouldClipboardClear {
260+
assert.Empty(t, p.m.copyItems.items, "Clipboard should be cleared after successful cut-paste")
261+
} else {
262+
assert.NotEmpty(t, p.m.copyItems.items, "Clipboard should remain after copy-paste")
263+
}
258264
})
259265
}
260266

src/internal/test_utils.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ func verifySuccessfulPasteResults(t *testing.T, targetDir string, expectedDestFi
200200
verifyPathNotExistsEventually(t, originalPath, "Original file should not exist after cut operation")
201201
}
202202
}
203-
204-
// TODO: Need to add a test to verify clipboard state.
205203
}
206204

207205
// -------------- Other utilities

0 commit comments

Comments
 (0)