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

add view asserter getter struct

This commit is contained in:
Jesse Duffield
2022-12-27 15:07:11 +11:00
parent b64f55518b
commit be30cbb375
35 changed files with 184 additions and 174 deletions

View File

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