1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

migrate staging tests

This commit is contained in:
Jesse Duffield
2023-02-23 22:29:40 +11:00
parent 1b52a0d83f
commit c63fed2074
199 changed files with 540 additions and 2476 deletions

View File

@ -28,7 +28,21 @@ func (self *CommitMessagePanelDriver) AddNewline() *CommitMessagePanelDriver {
}
func (self *CommitMessagePanelDriver) Clear() *CommitMessagePanelDriver {
panic("Clear method not yet implemented!")
// 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")
}
}
return self
}
func (self *CommitMessagePanelDriver) Confirm() {