/
githubmirror
/
lazygit
Обзор
Документация
Войти
/
githubmirror
/
lazygit
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
pkg/integration/tests/demo/diff_commits.go
44 строки
1 KB
Stefan Haller
Use getters for AppState and UserConfig instead of accessing the fields directly
18 авг 2024, 11:24
18 авг 2024, 11:24
55d8e80
Код
Авторство
О чём код?
package demo import ( "github.com/jesseduffield/lazygit/pkg/config" . "github.com/jesseduffield/lazygit/pkg/integration/components" ) var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Diff two commits", ExtraCmdArgs: []string{}, Skip: false, IsDemo: true, SetupConfig: func(config *config.AppConfig) { setDefaultDemoConfig(config) config.GetUserConfig().Gui.ShowFileTree = false config.GetUserConfig().Gui.ShowCommandLog = false }, SetupRepo: func(shell *Shell) { shell.CreateNCommitsWithRandomMessages(50) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.SetCaptionPrefix("Compare two commits") t.Wait(1000) t.Views().Commits(). Focus(). NavigateToLine(Contains("Replace deprecated lifecycle methods in React components")). Wait(1000). Press(keys.Universal.DiffingMenu). Tap(func() { t.ExpectPopup().Menu(). Title(Equals("Diffing")). TopLines( MatchesRegexp(`Diff .*`), ). Wait(500). Confirm() }). NavigateToLine(Contains("Move constants to a separate config file")). Wait(1000). PressEnter() }, })