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,30 +21,26 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
assert.SelectedLine(Contains("first-change-branch"))
input.NextItem()
assert.SelectedLine(Contains("second-change-branch"))
input.PressKeys(keys.Branches.RebaseBranch)
input.Press(keys.Branches.RebaseBranch)
assert.InConfirm()
assert.CurrentViewContent(Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?"))
input.Confirm()
input.AcceptConfirmation(Equals("Rebasing"), Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?"))
assert.InConfirm()
assert.CurrentViewContent(Contains("Conflicts!"))
input.Confirm()
input.AcceptConfirmation(Equals("Auto-merge failed"), Contains("Conflicts!"))
assert.CurrentViewName("files")
assert.SelectedLine(Contains("file"))
// not using Confirm() convenience method because I suspect we might change this
// keybinding to something more bespoke
input.PressKeys(keys.Universal.Confirm)
input.Press(keys.Universal.Confirm)
assert.CurrentViewName("mergeConflicts")
input.PrimaryAction()
assert.ViewContent("information", Contains("rebasing"))
assert.InConfirm()
assert.CurrentViewContent(Contains("all merge conflicts resolved. Continue?"))
input.Confirm()
input.AcceptConfirmation(Equals("continue"), Contains("all merge conflicts resolved. Continue?"))
assert.ViewContent("information", NotContains("rebasing"))
// this proves we actually have integrated the changes from second-change-branch