mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
remove dependency on model
This commit is contained in:
@ -22,9 +22,8 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
}
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Model().WorkingTreeFileCount(0)
|
||||
|
||||
t.Views().Files().
|
||||
IsEmpty().
|
||||
IsFocused().
|
||||
Press("a").
|
||||
Lines(
|
||||
|
@ -56,9 +56,8 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
}
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Model().WorkingTreeFileCount(0)
|
||||
|
||||
t.Views().Files().
|
||||
IsEmpty().
|
||||
IsFocused().
|
||||
Press("a")
|
||||
|
||||
@ -71,8 +70,11 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Content(Equals("Are you REALLY sure you want to make this file? Up to you buddy.")).
|
||||
Confirm()
|
||||
|
||||
t.Model().WorkingTreeFileCount(1)
|
||||
t.Views().Files().SelectedLine(Contains("my file"))
|
||||
t.Views().Files().
|
||||
Lines(
|
||||
Contains("my file").IsSelected(),
|
||||
)
|
||||
|
||||
t.Views().Main().Content(Contains(`"BAR"`))
|
||||
},
|
||||
})
|
||||
|
@ -43,7 +43,9 @@ var MenuFromCommand = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
}
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Model().WorkingTreeFileCount(0)
|
||||
t.Views().Files().
|
||||
IsEmpty()
|
||||
|
||||
t.Views().Branches().
|
||||
Focus().
|
||||
Press("a")
|
||||
@ -52,9 +54,12 @@ var MenuFromCommand = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
|
||||
t.ExpectPrompt().Title(Equals("Description")).Type(" my branch").Confirm()
|
||||
|
||||
t.Model().WorkingTreeFileCount(1)
|
||||
t.Views().Files().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("output.txt").IsSelected(),
|
||||
)
|
||||
|
||||
t.Views().Files().Focus().SelectedLine(Contains("output.txt"))
|
||||
t.Views().Main().Content(Contains("bar Branch: #feature/foo my branch feature/foo"))
|
||||
},
|
||||
})
|
||||
|
@ -42,8 +42,7 @@ var MenuFromCommandsOutput = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
}
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Model().CurrentBranchName("feature/bar")
|
||||
t.Model().WorkingTreeFileCount(0)
|
||||
t.Git().CurrentBranchName("feature/bar")
|
||||
|
||||
t.Views().Branches().
|
||||
Focus().
|
||||
@ -56,6 +55,6 @@ var MenuFromCommandsOutput = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
|
||||
t.ExpectMenu().Title(Equals("Branch:")).Select(Equals("master")).Confirm()
|
||||
|
||||
t.Model().CurrentBranchName("master")
|
||||
t.Git().CurrentBranchName("master")
|
||||
},
|
||||
})
|
||||
|
@ -54,9 +54,8 @@ var MultiplePrompts = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
}
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Model().WorkingTreeFileCount(0)
|
||||
|
||||
t.Views().Files().
|
||||
IsEmpty().
|
||||
IsFocused().
|
||||
Press("a")
|
||||
|
||||
@ -69,8 +68,12 @@ var MultiplePrompts = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Content(Equals("Are you REALLY sure you want to make this file? Up to you buddy.")).
|
||||
Confirm()
|
||||
|
||||
t.Model().WorkingTreeFileCount(1)
|
||||
t.Views().Files().SelectedLine(Contains("myfile"))
|
||||
t.Views().Files().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("myfile").IsSelected(),
|
||||
)
|
||||
|
||||
t.Views().Main().Content(Contains("BAR"))
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user