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

add helper functions for popups in tests

This commit is contained in:
Jesse Duffield
2022-12-24 17:48:57 +11:00
parent aedfce2845
commit b623ecf898
40 changed files with 380 additions and 402 deletions

View File

@ -61,23 +61,13 @@ var MultiplePrompts = NewIntegrationTest(NewIntegrationTestArgs{
) {
assert.WorkingTreeFileCount(0)
input.PressKeys("a")
input.Press("a")
assert.InPrompt()
assert.CurrentViewTitle(Equals("Enter a file name"))
input.Type("myfile")
input.Confirm()
input.Prompt(Equals("Enter a file name"), "myfile")
assert.InMenu()
assert.CurrentViewTitle(Equals("Choose file content"))
assert.SelectedLine(Contains("foo"))
input.NextItem()
assert.SelectedLine(Contains("bar"))
input.Confirm()
input.Menu(Equals("Choose file content"), Contains("bar"))
assert.InConfirm()
assert.CurrentViewTitle(Equals("Are you sure?"))
input.Confirm()
input.AcceptConfirmation(Equals("Are you sure?"), Equals("Are you REALLY sure you want to make this file? Up to you buddy."))
assert.WorkingTreeFileCount(1)
assert.SelectedLine(Contains("myfile"))