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

rename input to t

This commit is contained in:
Jesse Duffield
2022-12-27 21:35:36 +11:00
parent 53e06b71ae
commit 78b495f50a
45 changed files with 376 additions and 399 deletions

View File

@ -23,12 +23,12 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{
},
Run: func(
shell *Shell,
input *Input,
t *TestDriver,
keys config.KeybindingConfig,
) {
input.Model().WorkingTreeFileCount(0)
t.Model().WorkingTreeFileCount(0)
input.Views().Files().
t.Views().Files().
IsFocused().
Press("a").
Lines(

View File

@ -57,26 +57,26 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
},
Run: func(
shell *Shell,
input *Input,
t *TestDriver,
keys config.KeybindingConfig,
) {
input.Model().WorkingTreeFileCount(0)
t.Model().WorkingTreeFileCount(0)
input.Views().Files().
t.Views().Files().
IsFocused().
Press("a")
input.ExpectPrompt().Title(Equals("Enter a file name")).Type("my file").Confirm()
t.ExpectPrompt().Title(Equals("Enter a file name")).Type("my file").Confirm()
input.ExpectMenu().Title(Equals("Choose file content")).Select(Contains("bar")).Confirm()
t.ExpectMenu().Title(Equals("Choose file content")).Select(Contains("bar")).Confirm()
input.ExpectConfirmation().
t.ExpectConfirmation().
Title(Equals("Are you sure?")).
Content(Equals("Are you REALLY sure you want to make this file? Up to you buddy.")).
Confirm()
input.Model().WorkingTreeFileCount(1)
input.Views().Files().SelectedLine(Contains("my file"))
input.Views().Main().Content(Contains(`"BAR"`))
t.Model().WorkingTreeFileCount(1)
t.Views().Files().SelectedLine(Contains("my file"))
t.Views().Main().Content(Contains(`"BAR"`))
},
})

View File

@ -44,21 +44,21 @@ var MenuFromCommand = NewIntegrationTest(NewIntegrationTestArgs{
},
Run: func(
shell *Shell,
input *Input,
t *TestDriver,
keys config.KeybindingConfig,
) {
input.Model().WorkingTreeFileCount(0)
input.Views().Branches().
t.Model().WorkingTreeFileCount(0)
t.Views().Branches().
Focus().
Press("a")
input.ExpectMenu().Title(Equals("Choose commit message")).Select(Contains("bar")).Confirm()
t.ExpectMenu().Title(Equals("Choose commit message")).Select(Contains("bar")).Confirm()
input.ExpectPrompt().Title(Equals("Description")).Type(" my branch").Confirm()
t.ExpectPrompt().Title(Equals("Description")).Type(" my branch").Confirm()
input.Model().WorkingTreeFileCount(1)
t.Model().WorkingTreeFileCount(1)
input.Views().Files().Focus().SelectedLine(Contains("output.txt"))
input.Views().Main().Content(Contains("bar Branch: #feature/foo my branch feature/foo"))
t.Views().Files().Focus().SelectedLine(Contains("output.txt"))
t.Views().Main().Content(Contains("bar Branch: #feature/foo my branch feature/foo"))
},
})

View File

@ -43,23 +43,23 @@ var MenuFromCommandsOutput = NewIntegrationTest(NewIntegrationTestArgs{
},
Run: func(
shell *Shell,
input *Input,
t *TestDriver,
keys config.KeybindingConfig,
) {
input.Model().CurrentBranchName("feature/bar")
input.Model().WorkingTreeFileCount(0)
t.Model().CurrentBranchName("feature/bar")
t.Model().WorkingTreeFileCount(0)
input.Views().Branches().
t.Views().Branches().
Focus().
Press("a")
input.ExpectPrompt().
t.ExpectPrompt().
Title(Equals("Which git command do you want to run?")).
InitialText(Equals("branch")).
Confirm()
input.ExpectMenu().Title(Equals("Branch:")).Select(Equals("master")).Confirm()
t.ExpectMenu().Title(Equals("Branch:")).Select(Equals("master")).Confirm()
input.Model().CurrentBranchName("master")
t.Model().CurrentBranchName("master")
},
})

View File

@ -55,26 +55,26 @@ var MultiplePrompts = NewIntegrationTest(NewIntegrationTestArgs{
},
Run: func(
shell *Shell,
input *Input,
t *TestDriver,
keys config.KeybindingConfig,
) {
input.Model().WorkingTreeFileCount(0)
t.Model().WorkingTreeFileCount(0)
input.Views().Files().
t.Views().Files().
IsFocused().
Press("a")
input.ExpectPrompt().Title(Equals("Enter a file name")).Type("myfile").Confirm()
t.ExpectPrompt().Title(Equals("Enter a file name")).Type("myfile").Confirm()
input.ExpectMenu().Title(Equals("Choose file content")).Select(Contains("bar")).Confirm()
t.ExpectMenu().Title(Equals("Choose file content")).Select(Contains("bar")).Confirm()
input.ExpectConfirmation().
t.ExpectConfirmation().
Title(Equals("Are you sure?")).
Content(Equals("Are you REALLY sure you want to make this file? Up to you buddy.")).
Confirm()
input.Model().WorkingTreeFileCount(1)
input.Views().Files().SelectedLine(Contains("myfile"))
input.Views().Main().Content(Contains("BAR"))
t.Model().WorkingTreeFileCount(1)
t.Views().Files().SelectedLine(Contains("myfile"))
t.Views().Main().Content(Contains("BAR"))
},
})