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

@ -21,12 +21,19 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("current-branch commit")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
assert.ViewLines("commits",
Contains("current-branch commit"),
Contains("root commit"),
)
input.SwitchToBranchesWindow()
assert.CurrentViewName("localBranches")
assert.SelectedLine(Contains("current-branch"))
assert.CurrentViewLines(
Contains("current-branch"),
Contains("other-branch"),
)
input.NextItem()
assert.SelectedLine(Contains("other-branch"))
input.Press(keys.Commits.ViewResetOptions)
@ -38,9 +45,9 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
// assert that we now have the expected commits in the commit panel
input.SwitchToCommitsWindow()
assert.CurrentViewName("commits")
assert.CommitCount(2)
assert.SelectedLine(Contains("other-branch commit"))
input.NextItem()
assert.SelectedLine(Contains("root commit"))
assert.CurrentViewLines(
Contains("other-branch commit"),
Contains("root commit"),
)
},
})