1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
lazygit/pkg/integration/components/common.go

47 lines
1.1 KiB
Go
Raw Normal View History

2022-12-28 01:54:38 +02:00
package components
// for running common actions
2023-02-26 02:49:15 +02:00
type Common struct {
2022-12-28 01:54:38 +02:00
t *TestDriver
}
2023-02-26 02:49:15 +02:00
func (self *Common) ContinueMerge() {
self.t.GlobalPress(self.t.keys.Universal.CreateRebaseOptionsMenu)
2022-12-28 01:54:38 +02:00
2022-12-28 02:00:22 +02:00
self.t.ExpectPopup().Menu().
Title(Equals("Rebase options")).
2022-12-28 01:54:38 +02:00
Select(Contains("continue")).
Confirm()
}
2023-02-26 02:49:15 +02:00
func (self *Common) ContinueRebase() {
2022-12-28 01:54:38 +02:00
self.ContinueMerge()
}
2023-02-22 13:25:18 +02:00
2023-02-26 02:49:15 +02:00
func (self *Common) AcknowledgeConflicts() {
self.t.ExpectPopup().Menu().
Title(Equals("Conflicts!")).
Select(Contains("View conflicts")).
2023-02-22 13:25:18 +02:00
Confirm()
}
2023-02-26 02:49:15 +02:00
func (self *Common) ContinueOnConflictsResolved() {
2023-02-22 13:25:18 +02:00
self.t.ExpectPopup().Confirmation().
Title(Equals("Continue")).
Content(Contains("All merge conflicts resolved. Continue?")).
2023-02-22 13:25:18 +02:00
Confirm()
}
2023-02-23 13:29:40 +02:00
2023-02-26 02:49:15 +02:00
func (self *Common) ConfirmDiscardLines() {
2023-02-23 13:29:40 +02:00
self.t.ExpectPopup().Confirmation().
Title(Equals("Unstage lines")).
Content(Contains("Are you sure you want to delete the selected lines")).
Confirm()
}
2023-02-25 04:08:45 +02:00
func (self *Common) SelectPatchOption(matcher *TextMatcher) {
2023-02-25 04:08:45 +02:00
self.t.GlobalPress(self.t.keys.Universal.CreatePatchOptionsMenu)
self.t.ExpectPopup().Menu().Title(Equals("Patch options")).Select(matcher).Confirm()
2023-02-25 04:08:45 +02:00
}