mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-13 01:30:53 +02:00
combine assert and input structs, clean up interface
This commit is contained in:
@ -14,61 +14,56 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
shell.
|
||||
CreateNCommits(5) // these will appears at commit 05, 04, 04, down to 01
|
||||
},
|
||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||
input.SwitchToCommitsView()
|
||||
assert.Views().Current().Lines(
|
||||
Contains("commit 05"),
|
||||
Contains("commit 04"),
|
||||
Contains("commit 03"),
|
||||
Contains("commit 02"),
|
||||
Contains("commit 01"),
|
||||
)
|
||||
|
||||
input.NavigateToListItem(Contains("commit 02"))
|
||||
input.Press(keys.Universal.Edit)
|
||||
|
||||
assert.Views().Current().Lines(
|
||||
MatchesRegexp("pick.*commit 05"),
|
||||
MatchesRegexp("pick.*commit 04"),
|
||||
MatchesRegexp("pick.*commit 03"),
|
||||
MatchesRegexp("YOU ARE HERE.*commit 02"),
|
||||
Contains("commit 01"),
|
||||
)
|
||||
|
||||
input.PreviousItem()
|
||||
input.Press(keys.Commits.MarkCommitAsFixup)
|
||||
assert.Views().Current().Lines(
|
||||
MatchesRegexp("pick.*commit 05"),
|
||||
MatchesRegexp("pick.*commit 04"),
|
||||
MatchesRegexp("fixup.*commit 03"),
|
||||
MatchesRegexp("YOU ARE HERE.*commit 02"),
|
||||
Contains("commit 01"),
|
||||
)
|
||||
|
||||
input.PreviousItem()
|
||||
input.Press(keys.Universal.Remove)
|
||||
assert.Views().Current().Lines(
|
||||
MatchesRegexp("pick.*commit 05"),
|
||||
MatchesRegexp("drop.*commit 04"),
|
||||
MatchesRegexp("fixup.*commit 03"),
|
||||
MatchesRegexp("YOU ARE HERE.*commit 02"),
|
||||
Contains("commit 01"),
|
||||
)
|
||||
|
||||
input.PreviousItem()
|
||||
input.Press(keys.Commits.SquashDown)
|
||||
|
||||
assert.Views().Current().Lines(
|
||||
MatchesRegexp("squash.*commit 05"),
|
||||
MatchesRegexp("drop.*commit 04"),
|
||||
MatchesRegexp("fixup.*commit 03"),
|
||||
MatchesRegexp("YOU ARE HERE.*commit 02"),
|
||||
Contains("commit 01"),
|
||||
)
|
||||
Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
|
||||
input.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("commit 05"),
|
||||
Contains("commit 04"),
|
||||
Contains("commit 03"),
|
||||
Contains("commit 02"),
|
||||
Contains("commit 01"),
|
||||
).
|
||||
NavigateToListItem(Contains("commit 02")).
|
||||
Press(keys.Universal.Edit).
|
||||
Lines(
|
||||
MatchesRegexp("pick.*commit 05"),
|
||||
MatchesRegexp("pick.*commit 04"),
|
||||
MatchesRegexp("pick.*commit 03"),
|
||||
MatchesRegexp("YOU ARE HERE.*commit 02").IsSelected(),
|
||||
Contains("commit 01"),
|
||||
).
|
||||
SelectPreviousItem().
|
||||
Press(keys.Commits.MarkCommitAsFixup).
|
||||
Lines(
|
||||
MatchesRegexp("pick.*commit 05"),
|
||||
MatchesRegexp("pick.*commit 04"),
|
||||
MatchesRegexp("fixup.*commit 03").IsSelected(),
|
||||
MatchesRegexp("YOU ARE HERE.*commit 02"),
|
||||
Contains("commit 01"),
|
||||
).
|
||||
SelectPreviousItem().
|
||||
Press(keys.Universal.Remove).
|
||||
Lines(
|
||||
MatchesRegexp("pick.*commit 05"),
|
||||
MatchesRegexp("drop.*commit 04").IsSelected(),
|
||||
MatchesRegexp("fixup.*commit 03"),
|
||||
MatchesRegexp("YOU ARE HERE.*commit 02"),
|
||||
Contains("commit 01"),
|
||||
).
|
||||
SelectPreviousItem().
|
||||
Press(keys.Commits.SquashDown).
|
||||
Lines(
|
||||
MatchesRegexp("squash.*commit 05").IsSelected(),
|
||||
MatchesRegexp("drop.*commit 04"),
|
||||
MatchesRegexp("fixup.*commit 03"),
|
||||
MatchesRegexp("YOU ARE HERE.*commit 02"),
|
||||
Contains("commit 01"),
|
||||
)
|
||||
|
||||
input.ContinueRebase()
|
||||
|
||||
assert.Views().Current().Lines(
|
||||
input.Views().Commits().Lines(
|
||||
Contains("commit 02"),
|
||||
Contains("commit 01"),
|
||||
)
|
||||
|
Reference in New Issue
Block a user