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

@ -24,11 +24,9 @@ var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{
assert.SelectedLine(Contains("third commit"))
input.PressKeys(keys.Universal.DiffingMenu)
assert.InMenu()
assert.CurrentViewTitle(Equals("Diffing"))
assert.SelectedLine(Contains("diff"))
input.Confirm()
input.Press(keys.Universal.DiffingMenu)
input.Menu(Equals("Diffing"), MatchesRegexp(`diff \w+`))
assert.NotInPopup()
assert.ViewContent("information", Contains("showing output for: git diff"))
@ -40,10 +38,9 @@ var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{
assert.MainViewContent(Contains("-second line\n-third line"))
input.PressKeys(keys.Universal.DiffingMenu)
assert.InMenu()
input.NavigateToListItemContainingText("reverse diff direction")
input.Confirm()
input.Press(keys.Universal.DiffingMenu)
input.Menu(Equals("Diffing"), Contains("reverse diff direction"))
assert.NotInPopup()
assert.MainViewContent(Contains("+second line\n+third line"))