move input and assert into integration tests package

This commit is contained in:
Jesse Duffield
2022-08-09 21:11:41 +10:00
parent 46ae55f91e
commit d890238c7b
18 changed files with 164 additions and 436 deletions

View File

@@ -1,7 +1,6 @@
package types
import (
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
@@ -21,7 +20,7 @@ type Test interface {
// so that they appear when lazygit runs
SetupConfig(config *config.AppConfig)
// this is called upon lazygit starting
Run(GuiAdapter)
Run(types.GuiAdapter)
// e.g. '-debug'
ExtraCmdArgs() string
// for tests that are flakey and when we don't have time to fix them
@@ -98,18 +97,3 @@ type Assert interface {
// for when you just want to fail the test yourself
Fail(errorMessage string)
}
type GuiAdapter interface {
PressKey(string)
Keys() config.KeybindingConfig
CurrentContext() types.Context
Model() *types.Model
Fail(message string)
// These two log methods are for the sake of debugging while testing. There's no need to actually
// commit any logging.
// logs to the normal place that you log to i.e. viewable with `lazygit --logs`
Log(message string)
// logs in the actual UI (in the commands panel)
LogUI(message string)
CheckedOutRef() *models.Branch
}