mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-06-20 01:19:23 +02:00
cleaner test assertions
This commit is contained in:
@@ -24,9 +24,10 @@ var DirWithUntrackedFile = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||
assert.CommitCount(1)
|
||||
|
||||
assert.MainViewContent(NotContains("error: Could not access"))
|
||||
// we show baz because it's a modified file but we don't show bar because it's untracked
|
||||
// (though it would be cool if we could show that too)
|
||||
assert.MainViewContent(Contains("baz"))
|
||||
assert.MainView().
|
||||
Content(NotContains("error: Could not access")).
|
||||
// we show baz because it's a modified file but we don't show bar because it's untracked
|
||||
// (though it would be cool if we could show that too)
|
||||
Content(Contains("baz"))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -82,7 +82,7 @@ var DiscardChanges = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
|
||||
discardOneByOne := func(files []statusFile) {
|
||||
for _, file := range files {
|
||||
assert.CurrentLine(Contains(file.status + " " + file.label))
|
||||
assert.CurrentView().SelectedLine(Contains(file.status + " " + file.label))
|
||||
input.Press(keys.Universal.Remove)
|
||||
input.Menu(Equals(file.menuTitle), Contains("discard all changes"))
|
||||
}
|
||||
@@ -98,10 +98,7 @@ var DiscardChanges = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
{status: "DU", label: "deleted-us.txt", menuTitle: "deleted-us.txt"},
|
||||
})
|
||||
|
||||
assert.InConfirm()
|
||||
assert.CurrentViewTitle(Contains("continue"))
|
||||
assert.CurrentViewContent(Contains("all merge conflicts resolved. Continue?"))
|
||||
input.Press(keys.Universal.Return)
|
||||
input.DenyConfirmation(Equals("continue"), Contains("all merge conflicts resolved. Continue?"))
|
||||
|
||||
discardOneByOne([]statusFile{
|
||||
{status: "MD", label: "change-delete.txt", menuTitle: "change-delete.txt"},
|
||||
|
||||
Reference in New Issue
Block a user