summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/demo/amend_old_commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/integration/tests/demo/amend_old_commit.go')
-rw-r--r--pkg/integration/tests/demo/amend_old_commit.go62
1 files changed, 62 insertions, 0 deletions
diff --git a/pkg/integration/tests/demo/amend_old_commit.go b/pkg/integration/tests/demo/amend_old_commit.go
new file mode 100644
index 000000000..b77a62bd1
--- /dev/null
+++ b/pkg/integration/tests/demo/amend_old_commit.go
@@ -0,0 +1,62 @@
+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) {
+ // No idea why I had to use version 2: it should be using my own computer's
+ // font and the one iterm uses is version 3.
+ config.UserConfig.Gui.NerdFontsVersion = "2"
+ config.UserConfig.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()
+ })
+ },
+})