1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-02 09:21:40 +02:00

create actions struct

This commit is contained in:
Jesse Duffield 2022-12-28 10:54:38 +11:00
parent a27092a7ad
commit 7aa843c75a
3 changed files with 22 additions and 12 deletions

View File

@ -0,0 +1,19 @@
package components
// for running common actions
type Actions struct {
t *TestDriver
}
func (self *Actions) ContinueMerge() {
self.t.Views().current().Press(self.t.keys.Universal.CreateRebaseOptionsMenu)
self.t.ExpectMenu().
Title(Equals("Rebase Options")).
Select(Contains("continue")).
Confirm()
}
func (self *Actions) ContinueRebase() {
self.ContinueMerge()
}

View File

@ -42,17 +42,8 @@ func (self *TestDriver) typeContent(content string) {
}
}
func (self *TestDriver) ContinueMerge() {
self.Views().current().Press(self.keys.Universal.CreateRebaseOptionsMenu)
self.ExpectMenu().
Title(Equals("Rebase Options")).
Select(Contains("continue")).
Confirm()
}
func (self *TestDriver) ContinueRebase() {
self.ContinueMerge()
func (self *TestDriver) Actions() *Actions {
return &Actions{t: self}
}
// for when you want to allow lazygit to process something before continuing

View File

@ -61,7 +61,7 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{
Contains("commit 01"),
).
Tap(func() {
t.ContinueRebase()
t.Actions().ContinueRebase()
}).
Lines(
Contains("commit 02"),