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

@ -21,15 +21,14 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("current-branch commit")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
assert.ViewLines("commits",
assert.View("commits").Lines(
Contains("current-branch commit"),
Contains("root commit"),
)
input.SwitchToBranchesWindow()
assert.CurrentViewName("localBranches")
assert.CurrentViewLines(
assert.CurrentView().Name("localBranches").Lines(
Contains("current-branch"),
Contains("other-branch"),
)
@ -40,12 +39,11 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
input.Menu(Contains("reset to other-branch"), Contains("hard reset"))
// ensure that we've returned from the menu before continuing
assert.CurrentViewName("localBranches")
assert.CurrentView().Name("localBranches")
// assert that we now have the expected commits in the commit panel
input.SwitchToCommitsWindow()
assert.CurrentViewName("commits")
assert.CurrentViewLines(
assert.CurrentView().Name("commits").Lines(
Contains("other-branch commit"),
Contains("root commit"),
)