mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-04 23:37:41 +02:00
Add demo for staging lines
This commit is contained in:
parent
c43195efb6
commit
0152639ef0
85
pkg/integration/tests/demo/stage_lines.go
Normal file
85
pkg/integration/tests/demo/stage_lines.go
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
package demo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/jesseduffield/lazygit/pkg/config"
|
||||||
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||||
|
)
|
||||||
|
|
||||||
|
var originalFile = `# Lazygit
|
||||||
|
|
||||||
|
Simple terminal UI for git commands
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Homebrew
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
var updatedFile = `# Lazygit
|
||||||
|
|
||||||
|
Simple terminal UI for git
|
||||||
|
(Not too simple though)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Homebrew
|
||||||
|
|
||||||
|
Just do brew install lazygit and bada bing bada
|
||||||
|
boom you have begun on the path of laziness.
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
var StageLines = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
Description: "Stage individual lines",
|
||||||
|
ExtraCmdArgs: []string{},
|
||||||
|
Skip: false,
|
||||||
|
IsDemo: true,
|
||||||
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
|
// No idea why I had to use version 2: it should be using my own computer's
|
||||||
|
// font and the one iterm uses is version 3.
|
||||||
|
config.UserConfig.Gui.NerdFontsVersion = "2"
|
||||||
|
config.UserConfig.Gui.ShowFileTree = false
|
||||||
|
config.UserConfig.Gui.ShowCommandLog = false
|
||||||
|
},
|
||||||
|
SetupRepo: func(shell *Shell) {
|
||||||
|
shell.NewBranch("docs-fix")
|
||||||
|
shell.CreateNCommitsWithRandomMessages(30)
|
||||||
|
shell.CreateFileAndAdd("docs/README.md", originalFile)
|
||||||
|
shell.Commit("Update docs/README")
|
||||||
|
shell.UpdateFile("docs/README.md", updatedFile)
|
||||||
|
},
|
||||||
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||||
|
t.SetCaptionPrefix("Stage individual lines")
|
||||||
|
t.Wait(1000)
|
||||||
|
|
||||||
|
t.Views().Files().
|
||||||
|
IsFocused().
|
||||||
|
PressEnter()
|
||||||
|
|
||||||
|
t.Views().Staging().
|
||||||
|
IsFocused().
|
||||||
|
Press(keys.Main.ToggleDragSelect).
|
||||||
|
PressFast(keys.Universal.NextItem).
|
||||||
|
PressFast(keys.Universal.NextItem).
|
||||||
|
Wait(500).
|
||||||
|
PressPrimaryAction().
|
||||||
|
Wait(500).
|
||||||
|
PressEscape()
|
||||||
|
|
||||||
|
t.Views().Files().
|
||||||
|
IsFocused().
|
||||||
|
Press(keys.Files.CommitChanges).
|
||||||
|
Tap(func() {
|
||||||
|
t.ExpectPopup().CommitMessagePanel().
|
||||||
|
Type("Update tagline").
|
||||||
|
Confirm()
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Views().Commits().
|
||||||
|
Focus()
|
||||||
|
},
|
||||||
|
})
|
@ -96,6 +96,7 @@ var tests = []*components.IntegrationTest{
|
|||||||
demo.Filter,
|
demo.Filter,
|
||||||
demo.InteractiveRebase,
|
demo.InteractiveRebase,
|
||||||
demo.NukeWorkingTree,
|
demo.NukeWorkingTree,
|
||||||
|
demo.StageLines,
|
||||||
diff.Diff,
|
diff.Diff,
|
||||||
diff.DiffAndApplyPatch,
|
diff.DiffAndApplyPatch,
|
||||||
diff.DiffCommits,
|
diff.DiffCommits,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user