1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-25 12:24:47 +02:00
Stefan Haller 0b0910573b Extract test helper function checkRemoteBranches
We'll need it a few more times in the next test we add.
2024-12-01 10:59:54 +01:00

26 lines
586 B
Go

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()
}