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

cleaner test assertions

This commit is contained in:
Jesse Duffield
2022-12-26 11:12:56 +11:00
parent fa0414777f
commit 9a6f21ce42
34 changed files with 442 additions and 378 deletions

View File

@ -18,9 +18,8 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
input.SwitchToBranchesWindow()
assert.CurrentViewName("localBranches")
assert.CurrentViewLines(
assert.CurrentView().Name("localBranches").Lines(
MatchesRegexp(`\*.*branch-two`),
MatchesRegexp(`branch-one`),
MatchesRegexp(`master`),
@ -34,11 +33,11 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
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.CurrentViewLines(
MatchesRegexp(`\*.*branch-two`),
MatchesRegexp(`master`),
)
assert.CurrentLineIdx(1)
assert.CurrentView().Name("localBranches").
Lines(
MatchesRegexp(`\*.*branch-two`),
MatchesRegexp(`master`),
).
SelectedLineIdx(1)
},
})