forked from jesseduffield/lazygit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract test helper function checkRemoteBranches
We'll need it a few more times in the next test we add.
- Loading branch information
1 parent
92bce7d
commit 0b09105
Showing
2 changed files
with
31 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package branch | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
"github.com/samber/lo" | ||
) | ||
|
||
func checkRemoteBranches(t *TestDriver, keys config.KeybindingConfig, remoteName string, expectedBranches []string) { | ||
t.Views().Remotes(). | ||
Focus(). | ||
NavigateToLine(Contains(remoteName)). | ||
PressEnter() | ||
|
||
t.Views(). | ||
RemoteBranches(). | ||
Lines( | ||
lo.Map(expectedBranches, func(branch string, _ int) *TextMatcher { return Equals(branch) })..., | ||
). | ||
Press(keys.Universal.Return) | ||
|
||
t.Views(). | ||
Branches(). | ||
Focus() | ||
} |