-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add os.copyToClipboardCmd to allow for a custom command
Issue #1055 test: CopyPatchToClipboard (temporary commit for review)
- Loading branch information
1 parent
7e9f669
commit 52eef6c
Showing
6 changed files
with
70 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package misc | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
// We're emulating the clipboard by writing to a file called clipboard | ||
|
||
var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Copy a branch name to the clipboard using custom clipboard command template", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) { | ||
config.UserConfig.OS.CopyToClipboardCmd = "echo {{text}} > clipboard" | ||
}, | ||
|
||
SetupRepo: func(shell *Shell) { | ||
shell.NewBranch("branch-a") | ||
}, | ||
|
||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Branches(). | ||
Focus(). | ||
Lines( | ||
Contains("branch-a").IsSelected(), | ||
). | ||
Press(keys.Universal.CopyToClipboard) | ||
|
||
t.Views().Files(). | ||
Focus() | ||
|
||
t.GlobalPress(keys.Files.RefreshFiles) | ||
|
||
// Expect to see the clipboard file with contents | ||
t.Views().Files(). | ||
IsFocused(). | ||
Lines( | ||
Contains("clipboard").IsSelected(), | ||
) | ||
|
||
t.Views().Main().Content(Contains("branch-a")) | ||
}, | ||
}) |
49 changes: 0 additions & 49 deletions
49
pkg/integration/tests/patch_building/copy_patch_to_clipboard.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters