1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

combine assert and input structs, clean up interface

This commit is contained in:
Jesse Duffield
2022-12-27 16:27:36 +11:00
parent c5c9f5bb94
commit b166b8f776
47 changed files with 1021 additions and 912 deletions

View File

@ -18,18 +18,18 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{
CreateFileAndAdd("file-2", "change to stash2").
StashWithMessage("bar")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
input.SwitchToStashView()
Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
input.Views().Stash().
Focus().
Lines(
Equals("On master: bar"),
Equals("On master: foo"),
).
SelectNextItem().
Press(keys.Stash.RenameStash)
assert.Views().Current().Lines(
Equals("On master: bar"),
Equals("On master: foo"),
)
input.NextItem()
input.Press(keys.Stash.RenameStash)
input.ExpectPrompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm()
input.Prompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm()
assert.Views().Current().SelectedLine(Equals("On master: foo baz"))
input.Views().Stash().SelectedLine(Equals("On master: foo baz"))
},
})