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

@ -16,27 +16,28 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
NewBranch("branch-one").
NewBranch("branch-two")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
input.SwitchToBranchesView()
Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
input.Views().Branches().
Focus().
Lines(
MatchesRegexp(`\*.*branch-two`).IsSelected(),
MatchesRegexp(`branch-one`),
MatchesRegexp(`master`),
).
Press(keys.Universal.Remove)
assert.Views().Current().Lines(
MatchesRegexp(`\*.*branch-two`),
MatchesRegexp(`branch-one`),
MatchesRegexp(`master`),
)
input.ExpectAlert().Title(Equals("Error")).Content(Contains("You cannot delete the checked out branch!")).Confirm()
input.Press(keys.Universal.Remove)
input.Alert().Title(Equals("Error")).Content(Contains("You cannot delete the checked out branch!")).Confirm()
input.Views().Branches().
SelectNextItem().
Press(keys.Universal.Remove)
input.NextItem()
input.Press(keys.Universal.Remove)
input.Confirmation().
input.ExpectConfirmation().
Title(Equals("Delete Branch")).
Content(Contains("Are you sure you want to delete the branch 'branch-one'?")).
Confirm()
assert.Views().Current().Name("localBranches").
input.Views().Branches().IsFocused().
Lines(
MatchesRegexp(`\*.*branch-two`),
MatchesRegexp(`master`).IsSelected(),