mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
fix suggestions test
This commit is contained in:
@ -65,20 +65,18 @@ func (self *PromptAsserter) SuggestionTopLines(matchers ...*matcher) *PromptAsse
|
||||
return self
|
||||
}
|
||||
|
||||
func (self *PromptAsserter) SelectFirstSuggestion() *PromptAsserter {
|
||||
func (self *PromptAsserter) ConfirmFirstSuggestion() {
|
||||
self.t.press(self.t.keys.Universal.TogglePanel)
|
||||
self.t.Views().Suggestions().
|
||||
IsFocused().
|
||||
SelectedLineIdx(0)
|
||||
|
||||
return self
|
||||
SelectedLineIdx(0).
|
||||
PressEnter()
|
||||
}
|
||||
|
||||
func (self *PromptAsserter) SelectSuggestion(matcher *matcher) *PromptAsserter {
|
||||
func (self *PromptAsserter) ConfirmSuggestion(matcher *matcher) {
|
||||
self.t.press(self.t.keys.Universal.TogglePanel)
|
||||
self.t.Views().Suggestions().
|
||||
IsFocused().
|
||||
NavigateToListItem(matcher)
|
||||
|
||||
return self
|
||||
NavigateToListItem(matcher).
|
||||
PressEnter()
|
||||
}
|
||||
|
@ -207,13 +207,6 @@ func (self *TestDriver) inCommitMessagePanel() {
|
||||
})
|
||||
}
|
||||
|
||||
func (self *TestDriver) currentWindowName(expectedWindowName string) {
|
||||
self.assertWithRetries(func() (bool, string) {
|
||||
actual := self.gui.CurrentContext().GetView().Name()
|
||||
return actual == expectedWindowName, fmt.Sprintf("Expected current window name to be '%s', but got '%s'", expectedWindowName, actual)
|
||||
})
|
||||
}
|
||||
|
||||
// for making assertions on lazygit views
|
||||
func (self *TestDriver) Views() *Views {
|
||||
return &Views{t: self}
|
||||
|
@ -31,8 +31,7 @@ var Suggestions = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Title(Equals("Branch name:")).
|
||||
Type("branch-to").
|
||||
SuggestionTopLines(Contains("branch-to-checkout")).
|
||||
SelectFirstSuggestion().
|
||||
Confirm()
|
||||
ConfirmFirstSuggestion()
|
||||
|
||||
t.Git().CurrentBranchName("branch-to-checkout")
|
||||
},
|
||||
|
Reference in New Issue
Block a user