mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
refactor to not have Match at the start of assert method names, because it reads better that way
This commit is contained in:
@ -31,6 +31,6 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
|
||||
input.PressKeys("a")
|
||||
assert.WorkingTreeFileCount(1)
|
||||
assert.MatchSelectedLine(Contains("myfile"))
|
||||
assert.SelectedLine(Contains("myfile"))
|
||||
},
|
||||
})
|
||||
|
@ -66,23 +66,23 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
input.PressKeys("a")
|
||||
|
||||
assert.InPrompt()
|
||||
assert.MatchCurrentViewTitle(Equals("Enter a file name"))
|
||||
assert.CurrentViewTitle(Equals("Enter a file name"))
|
||||
input.Type("my file")
|
||||
input.Confirm()
|
||||
|
||||
assert.InMenu()
|
||||
assert.MatchCurrentViewTitle(Equals("Choose file content"))
|
||||
assert.MatchSelectedLine(Contains("foo"))
|
||||
assert.CurrentViewTitle(Equals("Choose file content"))
|
||||
assert.SelectedLine(Contains("foo"))
|
||||
input.NextItem()
|
||||
assert.MatchSelectedLine(Contains("bar"))
|
||||
assert.SelectedLine(Contains("bar"))
|
||||
input.Confirm()
|
||||
|
||||
assert.InConfirm()
|
||||
assert.MatchCurrentViewTitle(Equals("Are you sure?"))
|
||||
assert.CurrentViewTitle(Equals("Are you sure?"))
|
||||
input.Confirm()
|
||||
|
||||
assert.WorkingTreeFileCount(1)
|
||||
assert.MatchSelectedLine(Contains("my file"))
|
||||
assert.MatchMainViewContent(Contains(`"BAR"`))
|
||||
assert.SelectedLine(Contains("my file"))
|
||||
assert.MainViewContent(Contains(`"BAR"`))
|
||||
},
|
||||
})
|
||||
|
@ -54,21 +54,21 @@ var MenuFromCommand = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
input.PressKeys("a")
|
||||
|
||||
assert.InMenu()
|
||||
assert.MatchCurrentViewTitle(Equals("Choose commit message"))
|
||||
assert.MatchSelectedLine(Equals("baz"))
|
||||
assert.CurrentViewTitle(Equals("Choose commit message"))
|
||||
assert.SelectedLine(Equals("baz"))
|
||||
input.NextItem()
|
||||
assert.MatchSelectedLine(Equals("bar"))
|
||||
assert.SelectedLine(Equals("bar"))
|
||||
input.Confirm()
|
||||
|
||||
assert.InPrompt()
|
||||
assert.MatchCurrentViewTitle(Equals("Description"))
|
||||
assert.CurrentViewTitle(Equals("Description"))
|
||||
input.Type(" my branch")
|
||||
input.Confirm()
|
||||
|
||||
input.SwitchToFilesWindow()
|
||||
|
||||
assert.WorkingTreeFileCount(1)
|
||||
assert.MatchSelectedLine(Contains("output.txt"))
|
||||
assert.MatchMainViewContent(Contains("bar Branch: #feature/foo my branch feature/foo"))
|
||||
assert.SelectedLine(Contains("output.txt"))
|
||||
assert.MainViewContent(Contains("bar Branch: #feature/foo my branch feature/foo"))
|
||||
},
|
||||
})
|
||||
|
@ -53,15 +53,15 @@ var MenuFromCommandsOutput = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
input.PressKeys("a")
|
||||
|
||||
assert.InPrompt()
|
||||
assert.MatchCurrentViewTitle(Equals("Which git command do you want to run?"))
|
||||
assert.MatchSelectedLine(Equals("branch"))
|
||||
assert.CurrentViewTitle(Equals("Which git command do you want to run?"))
|
||||
assert.SelectedLine(Equals("branch"))
|
||||
input.Confirm()
|
||||
|
||||
assert.InMenu()
|
||||
assert.MatchCurrentViewTitle(Equals("Branch:"))
|
||||
assert.CurrentViewTitle(Equals("Branch:"))
|
||||
input.NextItem()
|
||||
input.NextItem()
|
||||
assert.MatchSelectedLine(Equals("master"))
|
||||
assert.SelectedLine(Equals("master"))
|
||||
input.Confirm()
|
||||
|
||||
assert.CurrentBranchName("master")
|
||||
|
@ -64,23 +64,23 @@ var MultiplePrompts = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
input.PressKeys("a")
|
||||
|
||||
assert.InPrompt()
|
||||
assert.MatchCurrentViewTitle(Equals("Enter a file name"))
|
||||
assert.CurrentViewTitle(Equals("Enter a file name"))
|
||||
input.Type("myfile")
|
||||
input.Confirm()
|
||||
|
||||
assert.InMenu()
|
||||
assert.MatchCurrentViewTitle(Equals("Choose file content"))
|
||||
assert.MatchSelectedLine(Contains("foo"))
|
||||
assert.CurrentViewTitle(Equals("Choose file content"))
|
||||
assert.SelectedLine(Contains("foo"))
|
||||
input.NextItem()
|
||||
assert.MatchSelectedLine(Contains("bar"))
|
||||
assert.SelectedLine(Contains("bar"))
|
||||
input.Confirm()
|
||||
|
||||
assert.InConfirm()
|
||||
assert.MatchCurrentViewTitle(Equals("Are you sure?"))
|
||||
assert.CurrentViewTitle(Equals("Are you sure?"))
|
||||
input.Confirm()
|
||||
|
||||
assert.WorkingTreeFileCount(1)
|
||||
assert.MatchSelectedLine(Contains("myfile"))
|
||||
assert.MatchMainViewContent(Contains("BAR"))
|
||||
assert.SelectedLine(Contains("myfile"))
|
||||
assert.MainViewContent(Contains("BAR"))
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user