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:
@ -20,9 +20,8 @@ var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
},
|
||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||
input.SwitchToCommitsWindow()
|
||||
assert.CurrentViewName("commits")
|
||||
|
||||
assert.CurrentViewLines(
|
||||
assert.CurrentView().Name("commits").Lines(
|
||||
Contains("third commit"),
|
||||
Contains("second commit"),
|
||||
Contains("first commit"),
|
||||
@ -33,24 +32,24 @@ var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
|
||||
assert.NotInPopup()
|
||||
|
||||
assert.ViewContent("information", Contains("showing output for: git diff"))
|
||||
assert.View("information").Content(Contains("showing output for: git diff"))
|
||||
|
||||
input.NextItem()
|
||||
input.NextItem()
|
||||
assert.CurrentLine(Contains("first commit"))
|
||||
assert.CurrentView().SelectedLine(Contains("first commit"))
|
||||
|
||||
assert.MainViewContent(Contains("-second line\n-third line"))
|
||||
assert.MainView().Content(Contains("-second line\n-third line"))
|
||||
|
||||
input.Press(keys.Universal.DiffingMenu)
|
||||
input.Menu(Equals("Diffing"), Contains("reverse diff direction"))
|
||||
assert.NotInPopup()
|
||||
|
||||
assert.MainViewContent(Contains("+second line\n+third line"))
|
||||
assert.MainView().Content(Contains("+second line\n+third line"))
|
||||
|
||||
input.Enter()
|
||||
|
||||
assert.CurrentViewName("commitFiles")
|
||||
assert.CurrentLine(Contains("file1"))
|
||||
assert.MainViewContent(Contains("+second line\n+third line"))
|
||||
assert.CurrentView().Name("commitFiles")
|
||||
assert.CurrentView().SelectedLine(Contains("file1"))
|
||||
assert.MainView().Content(Contains("+second line\n+third line"))
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user