summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/integration/tests')
-rw-r--r--pkg/integration/tests/branch/delete.go4
-rw-r--r--pkg/integration/tests/branch/delete_remote_branch_with_credential_prompt.go8
-rw-r--r--pkg/integration/tests/branch/rebase.go2
-rw-r--r--pkg/integration/tests/branch/rebase_abort_on_conflict.go2
-rw-r--r--pkg/integration/tests/branch/rebase_and_drop.go2
-rw-r--r--pkg/integration/tests/branch/rebase_cancel_on_conflict.go2
-rw-r--r--pkg/integration/tests/branch/rebase_copied_branch.go2
-rw-r--r--pkg/integration/tests/branch/rebase_does_not_autosquash.go2
-rw-r--r--pkg/integration/tests/branch/rebase_from_marked_base.go2
-rw-r--r--pkg/integration/tests/branch/rebase_onto_base_branch.go53
-rw-r--r--pkg/integration/tests/branch/rebase_to_upstream.go4
-rw-r--r--pkg/integration/tests/branch/reset_to_upstream.go4
-rw-r--r--pkg/integration/tests/branch/show_divergence_from_base_branch.go47
-rw-r--r--pkg/integration/tests/branch/sort_local_branches.go12
-rw-r--r--pkg/integration/tests/branch/sort_remote_branches.go5
-rw-r--r--pkg/integration/tests/commit/add_co_author_range.go105
-rw-r--r--pkg/integration/tests/commit/find_base_commit_for_fixup_disregard_main_branch.go47
-rw-r--r--pkg/integration/tests/commit/find_base_commit_for_fixup_only_added_lines.go84
-rw-r--r--pkg/integration/tests/commit/reset_author_range.go52
-rw-r--r--pkg/integration/tests/commit/search.go14
-rw-r--r--pkg/integration/tests/commit/set_author_range.go57
-rw-r--r--pkg/integration/tests/custom_commands/delete_from_history.go41
-rw-r--r--pkg/integration/tests/custom_commands/edit_history.go31
-rw-r--r--pkg/integration/tests/custom_commands/show_output_in_panel.go57
-rw-r--r--pkg/integration/tests/demo/rebase_onto.go2
-rw-r--r--pkg/integration/tests/interactive_rebase/advanced_interactive_rebase.go2
-rw-r--r--pkg/integration/tests/interactive_rebase/show_exec_todos.go57
-rw-r--r--pkg/integration/tests/patch_building/move_to_earlier_commit_from_added_file.go115
-rw-r--r--pkg/integration/tests/patch_building/move_to_index_from_added_file_with_conflict.go96
-rw-r--r--pkg/integration/tests/patch_building/move_to_index_part_of_adjacent_added_lines.go1
-rw-r--r--pkg/integration/tests/patch_building/move_to_later_commit_partial_hunk.go1
-rw-r--r--pkg/integration/tests/patch_building/move_to_new_commit_from_added_file.go88
-rw-r--r--pkg/integration/tests/patch_building/move_to_new_commit_from_deleted_file.go88
-rw-r--r--pkg/integration/tests/patch_building/move_to_new_commit_partial_hunk.go11
-rw-r--r--pkg/integration/tests/patch_building/remove_parts_of_added_file.go56
-rw-r--r--pkg/integration/tests/patch_building/specific_selection.go6
-rw-r--r--pkg/integration/tests/staging/diff_change_screen_mode.go47
-rw-r--r--pkg/integration/tests/staging/search.go2
-rw-r--r--pkg/integration/tests/stash/stash_staged_partial_file.go70
-rw-r--r--pkg/integration/tests/status/click_repo_name_to_open_repos_menu.go18
-rw-r--r--pkg/integration/tests/status/click_to_focus.go35
-rw-r--r--pkg/integration/tests/status/click_working_tree_state_to_open_rebase_options_menu.go27
-rw-r--r--pkg/integration/tests/status/show_divergence_from_base_branch.go27
-rw-r--r--pkg/integration/tests/sync/force_push.go4
-rw-r--r--pkg/integration/tests/sync/force_push_multiple_matching.go4
-rw-r--r--pkg/integration/tests/sync/force_push_multiple_upstream.go4
-rw-r--r--pkg/integration/tests/sync/force_push_remote_branch_not_stored_locally.go81
-rw-r--r--pkg/integration/tests/sync/force_push_triangular.go65
-rw-r--r--pkg/integration/tests/sync/pull.go4
-rw-r--r--pkg/integration/tests/sync/pull_and_set_upstream.go4
-rw-r--r--pkg/integration/tests/sync/pull_merge.go4
-rw-r--r--pkg/integration/tests/sync/pull_merge_conflict.go4
-rw-r--r--pkg/integration/tests/sync/pull_rebase.go4
-rw-r--r--pkg/integration/tests/sync/pull_rebase_conflict.go4
-rw-r--r--pkg/integration/tests/sync/pull_rebase_interactive_conflict.go4
-rw-r--r--pkg/integration/tests/sync/pull_rebase_interactive_conflict_drop.go4
-rw-r--r--pkg/integration/tests/sync/push.go2
-rw-r--r--pkg/integration/tests/sync/push_and_auto_set_upstream.go2
-rw-r--r--pkg/integration/tests/sync/push_and_set_upstream.go2
-rw-r--r--pkg/integration/tests/sync/push_follow_tags.go4
-rw-r--r--pkg/integration/tests/sync/push_no_follow_tags.go4
-rw-r--r--pkg/integration/tests/sync/push_with_credential_prompt.go6
-rw-r--r--pkg/integration/tests/sync/shared.go2
-rw-r--r--pkg/integration/tests/test_list.go26
-rw-r--r--pkg/integration/tests/ui/keybinding_suggestions_when_switching_repos.go42
65 files changed, 1601 insertions, 67 deletions
diff --git a/pkg/integration/tests/branch/delete.go b/pkg/integration/tests/branch/delete.go
index 0b6adfac4..f81eb0609 100644
--- a/pkg/integration/tests/branch/delete.go
+++ b/pkg/integration/tests/branch/delete.go
@@ -15,9 +15,9 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
CloneIntoRemote("origin").
EmptyCommit("blah").
NewBranch("branch-one").
- PushBranch("origin", "branch-one").
+ PushBranchAndSetUpstream("origin", "branch-one").
NewBranch("branch-two").
- PushBranch("origin", "branch-two").
+ PushBranchAndSetUpstream("origin", "branch-two").
EmptyCommit("deletion blocker").
NewBranch("branch-three")
},
diff --git a/pkg/integration/tests/branch/delete_remote_branch_with_credential_prompt.go b/pkg/integration/tests/branch/delete_remote_branch_with_credential_prompt.go
index f145eceaa..6e3f52028 100644
--- a/pkg/integration/tests/branch/delete_remote_branch_with_credential_prompt.go
+++ b/pkg/integration/tests/branch/delete_remote_branch_with_credential_prompt.go
@@ -18,7 +18,7 @@ var DeleteRemoteBranchWithCredentialPrompt = NewIntegrationTest(NewIntegrationTe
shell.NewBranch("mybranch")
- shell.PushBranch("origin", "mybranch")
+ shell.PushBranchAndSetUpstream("origin", "mybranch")
// actually getting a password prompt is tricky: it requires SSH'ing into localhost under a newly created, restricted, user.
// This is not easy to do in a cross-platform way, nor is it easy to do in a docker container.
@@ -44,7 +44,7 @@ var DeleteRemoteBranchWithCredentialPrompt = NewIntegrationTest(NewIntegrationTe
Confirm()
}
- t.Views().Status().Content(Contains("✓ repo → mybranch"))
+ t.Views().Status().Content(Equals("✓ repo → mybranch"))
deleteBranch()
@@ -66,7 +66,7 @@ var DeleteRemoteBranchWithCredentialPrompt = NewIntegrationTest(NewIntegrationTe
Content(Contains("incorrect username/password")).
Confirm()
- t.Views().Status().Content(Contains("✓ repo → mybranch"))
+ t.Views().Status().Content(Equals("✓ repo → mybranch"))
// try again with correct password
deleteBranch()
@@ -81,7 +81,7 @@ var DeleteRemoteBranchWithCredentialPrompt = NewIntegrationTest(NewIntegrationTe
Type("password").
Confirm()
- t.Views().Status().Content(Contains("repo → mybranch").DoesNotContain("✓"))
+ t.Views().Status().Content(Equals("(upstream gone) repo → mybranch"))
t.Views().Branches().TopLines(Contains("mybranch (upstream gone)"))
},
})
diff --git a/pkg/integration/tests/branch/rebase.go b/pkg/integration/tests/branch/rebase.go
index 66a235107..c7dc028af 100644
--- a/pkg/integration/tests/branch/rebase.go
+++ b/pkg/integration/tests/branch/rebase.go
@@ -31,7 +31,7 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu().
- Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")).
+ Title(Equals("Rebase 'first-change-branch'")).
Select(Contains("Simple rebase")).
Confirm()
diff --git a/pkg/integration/tests/branch/rebase_abort_on_conflict.go b/pkg/integration/tests/branch/rebase_abort_on_conflict.go
index 4eba77627..47f59d3d1 100644
--- a/pkg/integration/tests/branch/rebase_abort_on_conflict.go
+++ b/pkg/integration/tests/branch/rebase_abort_on_conflict.go
@@ -31,7 +31,7 @@ var RebaseAbortOnConflict = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu().
- Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")).
+ Title(Equals("Rebase 'first-change-branch'")).
Select(Contains("Simple rebase")).
Confirm()
diff --git a/pkg/integration/tests/branch/rebase_and_drop.go b/pkg/integration/tests/branch/rebase_and_drop.go
index 4c6712f23..60ef19e6a 100644
--- a/pkg/integration/tests/branch/rebase_and_drop.go
+++ b/pkg/integration/tests/branch/rebase_and_drop.go
@@ -37,7 +37,7 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu().
- Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")).
+ Title(Equals("Rebase 'first-change-branch'")).
Select(Contains("Simple rebase")).
Confirm()
diff --git a/pkg/integration/tests/branch/rebase_cancel_on_conflict.go b/pkg/integration/tests/branch/rebase_cancel_on_conflict.go
index 23b7661b2..03923c81d 100644
--- a/pkg/integration/tests/branch/rebase_cancel_on_conflict.go
+++ b/pkg/integration/tests/branch/rebase_cancel_on_conflict.go
@@ -31,7 +31,7 @@ var RebaseCancelOnConflict = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu().
- Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")).
+ Title(Equals("Rebase 'first-change-branch'")).
Select(Contains("Simple rebase")).
Confirm()
diff --git a/pkg/integration/tests/branch/rebase_copied_branch.go b/pkg/integration/tests/branch/rebase_copied_branch.go
index faa31093e..bc9fcb4a6 100644
--- a/pkg/integration/tests/branch/rebase_copied_branch.go
+++ b/pkg/integration/tests/branch/rebase_copied_branch.go
@@ -42,7 +42,7 @@ var RebaseCopiedBranch = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch).
Tap(func() {
t.ExpectPopup().Menu().
- Title(Equals("Rebase 'branch2' onto 'master'")).
+ Title(Equals("Rebase 'branch2'")).
Select(Contains("Simple rebase")).
Confirm()
})
diff --git a/pkg/integration/tests/branch/rebase_does_not_autosquash.go b/pkg/integration/tests/branch/rebase_does_not_autosquash.go
index 66ad870c4..523682410 100644
--- a/pkg/integration/tests/branch/rebase_does_not_autosquash.go
+++ b/pkg/integration/tests/branch/rebase_does_not_autosquash.go
@@ -40,7 +40,7 @@ var RebaseDoesNotAutosquash = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu().
- Title(Equals("Rebase 'my-branch' onto 'master'")).
+ Title(Equals("Rebase 'my-branch'")).
Select(Contains("Simple rebase")).
Confirm()
diff --git a/pkg/integration/tests/branch/rebase_from_marked_base.go b/pkg/integration/tests/branch/rebase_from_marked_base.go
index c2ee307e3..c26dce9a3 100644
--- a/pkg/integration/tests/branch/rebase_from_marked_base.go
+++ b/pkg/integration/tests/branch/rebase_from_marked_base.go
@@ -61,7 +61,7 @@ var RebaseFromMarkedBase = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu().
- Title(Equals("Rebase 'active-branch' from marked base onto 'target-branch'")).
+ Title(Equals("Rebase 'active-branch' from marked base")).
Select(Contains("Simple rebase")).
Confirm()
diff --git a/pkg/integration/tests/branch/rebase_onto_base_branch.go b/pkg/integration/tests/branch/rebase_onto_base_branch.go
new file mode 100644
index 000000000..3944f4fe6
--- /dev/null
+++ b/pkg/integration/tests/branch/rebase_onto_base_branch.go
@@ -0,0 +1,53 @@
+package branch
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var RebaseOntoBaseBranch = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Rebase the current branch onto its base branch",
+ ExtraCmdArgs: []string{},
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {
+ config.UserConfig.Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
+ },
+ SetupRepo: func(shell *Shell) {
+ shell.
+ EmptyCommit("master 1").
+ EmptyCommit("master 2").
+ EmptyCommit("master 3").
+ NewBranchFrom("feature", "master^").
+ EmptyCommit("feature 1").
+ EmptyCommit("feature 2")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Commits().Lines(
+ Contains("feature 2"),
+ Contains("feature 1"),
+ Contains("master 2"),
+ Contains("master 1"),
+ )
+
+ t.Views().Branches().
+ Focus().
+ Lines(
+ Contains("feature ↓1").IsSelected(),
+ Contains("master"),
+ ).
+ Press(keys.Branches.RebaseBranch)
+
+ t.ExpectPopup().Menu().
+ Title(Equals("Rebase 'feature'")).
+ Select(Contains("Rebase onto base branch (master)")).
+ Confirm()
+
+ t.Views().Commits().Lines(
+ Contains("feature 2"),
+ Contains("feature 1"),
+ Contains("master 3"),
+ Contains("master 2"),
+ Contains("master 1"),
+ )
+ },
+})
diff --git a/pkg/integration/tests/branch/rebase_to_upstream.go b/pkg/integration/tests/branch/rebase_to_upstream.go
index 5c9e0f388..f8b2d6fd1 100644
--- a/pkg/integration/tests/branch/rebase_to_upstream.go
+++ b/pkg/integration/tests/branch/rebase_to_upstream.go
@@ -15,7 +15,7 @@ var RebaseToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
CloneIntoRemote("origin").
EmptyCommit("ensure-master").
EmptyCommit("to-be-added"). // <- this will only exist remotely
- PushBranch("origin", "master").
+ PushBranchAndSetUpstream("origin", "master").
HardReset("HEAD~1").
NewBranchFrom("base-branch", "master").
EmptyCommit("base-branch-commit").
@@ -67,7 +67,7 @@ var RebaseToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
Select(Contains("Rebase checked-out branch onto origin/master...")).
Confirm()
t.ExpectPopup().Menu().
- Title(Equals("Rebase 'target' onto 'origin/master'")).
+ Title(Equals("Rebase 'target'")).
Select(Contains("Simple rebase")).
Confirm()
})
diff --git a/pkg/integration/tests/branch/reset_to_upstream.go b/pkg/integration/tests/branch/reset_to_upstream.go
index c933787e4..3cdbb561d 100644
--- a/pkg/integration/tests/branch/reset_to_upstream.go
+++ b/pkg/integration/tests/branch/reset_to_upstream.go
@@ -15,10 +15,10 @@ var ResetToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
CloneIntoRemote("origin").
NewBranch("hard-branch").
EmptyCommit("hard commit").
- PushBranch("origin", "hard-branch").
+ PushBranchAndSetUpstream("origin", "hard-branch").
NewBranch("soft-branch").
EmptyCommit("soft commit").
- PushBranch("origin", "soft-branch").
+ PushBranchAndSetUpstream("origin", "soft-branch").
NewBranch("base").
EmptyCommit("base-branch commit").
CreateFile("file-1", "content").
diff --git a/pkg/integration/tests/branch/show_divergence_from_base_branch.go b/pkg/integration/tests/branch/show_divergence_from_base_branch.go
new file mode 100644
index 000000000..3efc0d76c
--- /dev/null
+++ b/pkg/integration/tests/branch/show_divergence_from_base_branch.go
@@ -0,0 +1,47 @@
+package branch
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var ShowDivergenceFromBaseBranch = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Show divergence from base branch",
+ ExtraCmdArgs: []string{},
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {
+ config.UserConfig.Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
+ },
+ SetupRepo: func(shell *Shell) {
+ shell.
+ EmptyCommit("master 1").
+ EmptyCommit("master 2").
+ EmptyCommit("master 3").
+ NewBranchFrom("feature", "master^").
+ EmptyCommit("feature 1").
+ EmptyCommit("feature 2")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Branches().
+ Focus().
+ Lines(
+ Contains("feature ↓1").IsSelected(),
+ Contains("master"),
+ ).
+ Press(keys.Branches.SetUpstream)
+
+ t.ExpectPopup().Menu().Title(Contains("Upstream")).
+ Select(Contains("View divergence from base branch (master)")).Confirm()
+
+ t.Views().SubCommits().
+ IsFocused().
+ Title(Contains("Commits (feature <-> master)")).
+ Lines(
+ DoesNotContainAnyOf("↓", "↑").Contains("--- Remote ---"),
+ Contains("↓").Contains("master 3"),
+ DoesNotContainAnyOf("↓", "↑").Contains("--- Local ---"),
+ Contains("↑").Contains("feature 2"),
+ Contains("↑").Contains("feature 1"),
+ )
+ },
+})
diff --git a/pkg/integration/tests/branch/sort_local_branches.go b/pkg/integration/tests/branch/sort_local_branches.go
index 9daf28424..ceff654be 100644
--- a/pkg/integration/tests/branch/sort_local_branches.go
+++ b/pkg/integration/tests/branch/sort_local_branches.go
@@ -37,6 +37,12 @@ var SortLocalBranches = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.SortOrder)
t.ExpectPopup().Menu().Title(Equals("Sort order")).
+ Lines(
+ Contains("r (•) Recency").IsSelected(),
+ Contains("a ( ) Alphabetical"),
+ Contains("d ( ) Date"),
+ Contains(" Cancel"),
+ ).
Select(Contains("-committerdate")).
Confirm()
@@ -53,6 +59,12 @@ var SortLocalBranches = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.SortOrder)
t.ExpectPopup().Menu().Title(Equals("Sort order")).
+ Lines(
+ Contains("r ( ) Recency").IsSelected(),
+ Contains("a ( ) Alphabetical"),
+ Contains("d (•) Date"),
+ Contains(" Cancel"),
+ ).
Select(Contains("refname")).
Confirm()
diff --git a/pkg/integration/tests/branch/sort_remote_branches.go b/pkg/integration/tests/branch/sort_remote_branches.go
index 35e2f700a..2cbbdb31d 100644
--- a/pkg/integration/tests/branch/sort_remote_branches.go
+++ b/pkg/integration/tests/branch/sort_remote_branches.go
@@ -41,6 +41,11 @@ var SortRemoteBranches = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.SortOrder)
t.ExpectPopup().Menu().Title(Equals("Sort order")).
+ Lines(
+ Contains("a (•) Alphabetical").IsSelected(),
+ Contains("d ( ) Date"),
+ Contains(" Cancel"),
+ ).
Select(Contains("-committerdate")).
Confirm()
diff --git a/pkg/integration/tests/commit/add_co_author_range.go b/pkg/integration/tests/commit/add_co_author_range.go
new file mode 100644
index 000000000..9452c1ded
--- /dev/null
+++ b/pkg/integration/tests/commit/add_co_author_range.go
@@ -0,0 +1,105 @@
+package commit
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var AddCoAuthorRange = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Add co-author on a range of commits",
+ ExtraCmdArgs: []string{},
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {},
+ SetupRepo: func(shell *Shell) {
+ shell.EmptyCommit("fourth commit")
+ shell.EmptyCommit("third commit")
+ shell.EmptyCommit("second commit")
+ shell.EmptyCommit("first commit")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Commits().