/
githubmirror
/
lazygit
Обзор
Документация
Войти
/
githubmirror
/
lazygit
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
pkg/integration/tests/demo/amend_old_commit.go
60 строк
2 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 AmendOldCommit = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Amend old commit", ExtraCmdArgs: []string{}, Skip: false, IsDemo: true, SetupConfig: func(config *config.AppConfig) { setDefaultDemoConfig(config) config.GetUserConfig().Gui.ShowFileTree = false }, SetupRepo: func(shell *Shell) { shell.CreateNCommitsWithRandomMessages(60) shell.NewBranch("feature/demo") shell.CloneIntoRemote("origin") shell.SetBranchUpstream("feature/demo", "origin/feature/demo") shell.UpdateFile("navigation/site_navigation.go", "package navigation\n\nfunc Navigate() {\n\tpanic(\"unimplemented\")\n}") shell.CreateFile("docs/README.md", "my readme content") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.SetCaptionPrefix("Amend an old commit") t.Wait(1000) t.Views().Files(). IsFocused(). SelectedLine(Contains("site_navigation.go")). PressPrimaryAction() t.Views().Commits(). Focus(). NavigateToLine(Contains("Improve accessibility of site navigation")). Wait(500). Press(keys.Commits.AmendToCommit). Tap(func() { t.ExpectPopup().Confirmation(). Title(Equals("Amend commit")). Wait(1000). Content(AnyString()). Confirm() t.Wait(1000) }). Press(keys.Universal.Push). Tap(func() { t.ExpectPopup().Confirmation(). Title(Equals("Force push")). Content(AnyString()). Wait(1000). Confirm() }) }, })