1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

remove dependency on model

This commit is contained in:
Jesse Duffield
2022-12-27 22:52:20 +11:00
parent c5050ecabd
commit ed93e0a2b0
32 changed files with 200 additions and 178 deletions

View File

@ -8,7 +8,6 @@ import (
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/types"
integrationTypes "github.com/jesseduffield/lazygit/pkg/integration/types"
"github.com/samber/lo"
)
type TestDriver struct {
@ -220,9 +219,9 @@ func (self *TestDriver) Views() *Views {
return &Views{t: self}
}
// for making assertions on the lazygit model
func (self *TestDriver) Model() *Model {
return &Model{assertionHelper: self.assertionHelper, gui: self.gui}
// for making assertions through git itself
func (self *TestDriver) Git() *Git {
return &Git{assertionHelper: self.assertionHelper, shell: self.shell}
}
// for making assertions on the file system
@ -235,10 +234,3 @@ func (self *TestDriver) FileSystem() *FileSystem {
func (self *TestDriver) Fail(message string) {
self.assertionHelper.fail(message)
}
func (self *TestDriver) NotInPopup() {
self.assertWithRetries(func() (bool, string) {
viewName := self.gui.CurrentContext().GetView().Name()
return !lo.Contains([]string{"menu", "confirmation", "commitMessage"}, viewName), fmt.Sprintf("Unexpected popup view present: %s view", viewName)
})
}