mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
Improve and adapt commit persistence test-cases
This commit is contained in:
parent
a32be7e9fa
commit
6065908b0d
4 changed files with 43 additions and 15 deletions
|
@ -39,20 +39,7 @@ func (self *CommitMessagePanelDriver) SwitchToDescription() *CommitDescriptionPa
|
|||
}
|
||||
|
||||
func (self *CommitMessagePanelDriver) Clear() *CommitMessagePanelDriver {
|
||||
// clearing multiple times in case there's multiple lines
|
||||
// (the clear button only clears a single line at a time)
|
||||
maxAttempts := 100
|
||||
for i := 0; i < maxAttempts+1; i++ {
|
||||
if self.getViewDriver().getView().Buffer() == "" {
|
||||
break
|
||||
}
|
||||
|
||||
self.t.press(ClearKey)
|
||||
if i == maxAttempts {
|
||||
panic("failed to clear commit message panel")
|
||||
}
|
||||
}
|
||||
|
||||
self.getViewDriver().Clear()
|
||||
return self
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue