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:
@ -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(),
|
||||
|
Reference in New Issue
Block a user