-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55d31b5
commit cd66f32
Showing
10 changed files
with
440 additions
and
3 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
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
77 changes: 77 additions & 0 deletions
77
pkg/integration/tests/custom_commands/custom_commands_menu.go
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,77 @@ | ||
package custom_commands | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var CustomCommandsMenu = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Using custom commands from a custom commands menu", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupRepo: func(shell *Shell) { | ||
// shell.EmptyCommit("blah") | ||
}, | ||
SetupConfig: func(cfg *config.AppConfig) { | ||
cfg.GetUserConfig().CustomCommandsMenus = []config.CustomCommandsMenu{ | ||
{ | ||
Key: "x", | ||
Description: "My Custom Commands", | ||
Commands: []config.CustomCommand{ | ||
{ | ||
Key: "1", | ||
Context: "global", | ||
Command: "touch myfile-global", | ||
}, | ||
{ | ||
Key: "2", | ||
Context: "files", | ||
Command: "touch myfile-files", | ||
}, | ||
{ | ||
Key: "3", | ||
Context: "commits", | ||
Command: "touch myfile-commits", | ||
}, | ||
}, | ||
}, | ||
} | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Files(). | ||
Focus(). | ||
IsEmpty(). | ||
Press("x"). | ||
Tap(func() { | ||
t.ExpectPopup().Menu(). | ||
Title(Equals("My Custom Commands")). | ||
Lines( | ||
Contains("1 touch myfile-global"), | ||
Contains("2 touch myfile-files"), | ||
). | ||
Select(Contains("touch myfile-files")).Confirm() | ||
}). | ||
Lines( | ||
Contains("myfile-files"), | ||
) | ||
|
||
t.Views().Commits(). | ||
Focus(). | ||
Press("x"). | ||
Tap(func() { | ||
t.ExpectPopup().Menu(). | ||
Title(Equals("My Custom Commands")). | ||
Lines( | ||
Contains("1 touch myfile-global"), | ||
Contains("3 touch myfile-commits"), | ||
) | ||
t.GlobalPress("3") | ||
}) | ||
|
||
t.Views().Files(). | ||
Lines( | ||
Contains("myfile-commits"), | ||
Contains("myfile-files"), | ||
) | ||
}, | ||
}) |
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
Oops, something went wrong.