1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

add helper functions for popups in tests

This commit is contained in:
Jesse Duffield
2022-12-24 17:48:57 +11:00
parent aedfce2845
commit b623ecf898
40 changed files with 380 additions and 402 deletions

View File

@ -21,18 +21,15 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
assert.CurrentViewName("localBranches")
assert.SelectedLine(Contains("branch-two"))
input.PressKeys(keys.Universal.Remove)
assert.InAlert()
assert.CurrentViewContent(Contains("You cannot delete the checked out branch!"))
input.Confirm()
input.Press(keys.Universal.Remove)
input.Alert(Equals("Error"), Contains("You cannot delete the checked out branch!"))
input.NextItem()
assert.SelectedLine(Contains("branch-one"))
input.PressKeys(keys.Universal.Remove)
assert.InConfirm()
assert.CurrentViewContent(Contains("Are you sure you want to delete the branch 'branch-one'?"))
input.Confirm()
input.Press(keys.Universal.Remove)
input.AcceptConfirmation(Equals("Delete Branch"), Contains("Are you sure you want to delete the branch 'branch-one'?"))
assert.CurrentViewName("localBranches")
assert.SelectedLine(Contains("master"))
assert.CurrentViewContent(NotContains("branch-one"))