mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Add "Absolute path" item to the file view's copy menu
Rename the existing item to "Relative path".
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package diff
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
@ -63,7 +65,7 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Copy to clipboard")).
|
||||
Select(Contains("Path")).
|
||||
Select(Contains("Relative path")).
|
||||
Confirm().
|
||||
Tap(func() {
|
||||
t.ExpectToast(Equals("File path copied to clipboard"))
|
||||
@ -71,6 +73,19 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
})
|
||||
}).
|
||||
Press(keys.Files.CopyFileInfoToClipboard).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Copy to clipboard")).
|
||||
Select(Contains("Absolute path")).
|
||||
Confirm().
|
||||
Tap(func() {
|
||||
t.ExpectToast(Equals("File path copied to clipboard"))
|
||||
repoDir, _ := os.Getwd()
|
||||
// On windows the following path would have backslashes, but we don't run integration tests on windows yet.
|
||||
expectClipboard(t, Equals(repoDir+"/dir/file1"))
|
||||
})
|
||||
}).
|
||||
Press(keys.Files.CopyFileInfoToClipboard).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Copy to clipboard")).
|
||||
|
Reference in New Issue
Block a user