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

introduce ViewLines functions

This commit is contained in:
Jesse Duffield
2022-12-25 11:38:00 +11:00
parent b623ecf898
commit 5d2584a188
14 changed files with 217 additions and 61 deletions

View File

@ -20,18 +20,25 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
input.SwitchToBranchesWindow()
assert.CurrentViewName("localBranches")
assert.SelectedLine(Contains("branch-two"))
assert.CurrentViewLines(
MatchesRegexp(`\*.*branch-two`),
MatchesRegexp(`branch-one`),
MatchesRegexp(`master`),
)
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.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"))
assert.CurrentViewLines(
MatchesRegexp(`\*.*branch-two`),
MatchesRegexp(`master`),
)
assert.SelectedLineIdx(1)
},
})