-
-
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.
After switching to another repo and then back to the original one, all keybinding suggestions in the status bar are shown twice.
- Loading branch information
1 parent
c08a5fe
commit c828963
Showing
3 changed files
with
52 additions
and
0 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
45 changes: 45 additions & 0 deletions
45
pkg/integration/tests/ui/keybinding_suggestions_when_switching_repos.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,45 @@ | ||
package ui | ||
|
||
import ( | ||
"path/filepath" | ||
|
||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var KeybindingSuggestionsWhenSwitchingRepos = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Show correct keybinding suggestions after switching between repos", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) { | ||
otherRepo, _ := filepath.Abs("../other") | ||
config.AppState.RecentRepos = []string{otherRepo} | ||
}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.CloneNonBare("other") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
switchToRepo := func(repo string) { | ||
t.GlobalPress(keys.Universal.OpenRecentRepos) | ||
t.ExpectPopup().Menu().Title(Equals("Recent repositories")). | ||
Lines( | ||
Contains(repo).IsSelected(), | ||
Contains("Cancel"), | ||
).Confirm() | ||
t.Views().Status().Content(Contains(repo + " → master")) | ||
} | ||
|
||
t.Views().Files().Focus() | ||
t.Views().Options().Content( | ||
Equals("Commit: c | Stash: s | Reset: D | Keybindings: ? | Cancel: <esc>")) | ||
|
||
switchToRepo("other") | ||
switchToRepo("repo") | ||
|
||
t.Views().Options().Content( | ||
/* EXPECTED: | ||
Equals("Commit: c | Stash: s | Reset: D | Keybindings: ? | Cancel: <esc>")) | ||
ACTUAL (all keybindings appear twice): */ | ||
Equals("Commit: c | Stash: s | Reset: D | Commit: c | Stash: s | Reset: D | Keybindings: ? | Cancel: <esc> | Keybindings: ? | Cancel: <esc>")) | ||
}, | ||
}) |