1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-01 00:54:58 +02: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

@ -15,28 +15,28 @@ var Revert = NewIntegrationTest(NewIntegrationTestArgs{
shell.GitAddAll()
shell.Commit("first commit")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
assert.Model().CommitCount(1)
Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
input.Model().CommitCount(1)
input.SwitchToCommitsView()
input.Views().Commits().
Focus().
Lines(
Contains("first commit"),
).
Press(keys.Commits.RevertCommit)
assert.Views().Current().Lines(
Contains("first commit"),
)
input.Press(keys.Commits.RevertCommit)
input.Confirmation().
input.ExpectConfirmation().
Title(Equals("Revert commit")).
Content(MatchesRegexp(`Are you sure you want to revert \w+?`)).
Confirm()
assert.Views().Current().Name("commits").
input.Views().Commits().IsFocused().
Lines(
Contains("Revert \"first commit\"").IsSelected(),
Contains("first commit"),
)
assert.Views().Main().Content(Contains("-myfile content"))
assert.FileSystem().PathNotPresent("myfile")
input.Views().Main().Content(Contains("-myfile content"))
input.FileSystem().PathNotPresent("myfile")
},
})