mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-19 17:02:18 +03:00
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE. Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything is in 'Sentence case' there's no need for the distinction. I've got a couple lower case things I've kept: namely, things that show up in parentheses.
41 lines
998 B
Go
41 lines
998 B
Go
package commit
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var NewBranch = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Creating a new branch from a commit",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.
|
|
EmptyCommit("commit 1").
|
|
EmptyCommit("commit 2").
|
|
EmptyCommit("commit 3")
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Commits().
|
|
Focus().
|
|
Lines(
|
|
Contains("commit 3").IsSelected(),
|
|
Contains("commit 2"),
|
|
Contains("commit 1"),
|
|
).
|
|
SelectNextItem().
|
|
Press(keys.Universal.New).
|
|
Tap(func() {
|
|
branchName := "my-branch-name"
|
|
t.ExpectPopup().Prompt().Title(Contains("New branch name")).Type(branchName).Confirm()
|
|
|
|
t.Git().CurrentBranchName(branchName)
|
|
}).
|
|
Lines(
|
|
Contains("commit 2"),
|
|
Contains("commit 1"),
|
|
)
|
|
},
|
|
})
|