blob: 2bd4fa340a08aa47370a8d629ca3927e557710f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
package branch
import (
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/integration/components"
)
var Suggestions = components.NewIntegrationTest(components.NewIntegrationTestArgs{
Description: "Checking out a branch with name suggestions",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *components.Shell) {
shell.
EmptyCommit("my commit message").
NewBranch("new-branch").
NewBranch("new-branch-2").
NewBranch("new-branch-3").
NewBranch("branch-to-checkout").
NewBranch("other-new-branch-2").
NewBranch("other-new-branch-3")
},
Run: func(shell *components.Shell, input *components.Input, assert *components.Assert, keys config.KeybindingConfig) {
input.SwitchToBranchesWindow()
input.PressKeys(keys.Branches.CheckoutBranchByName)
assert.CurrentViewName("confirmation")
input.Type("branch-to")
input.PressKeys(keys.Universal.TogglePanel)
assert.CurrentViewName("suggestions")
// we expect the first suggestion to be the branch we want because it most
// closely matches what we typed in
input.Confirm()
assert.CurrentBranchName("branch-to-checkout")
},
})
|