diff options
36 files changed, 208 insertions, 208 deletions
diff --git a/pkg/integration/components/assert.go b/pkg/integration/components/assert.go index f2a3137f6..ab7d079c8 100644 --- a/pkg/integration/components/assert.go +++ b/pkg/integration/components/assert.go @@ -115,7 +115,7 @@ func (self *Assert) AtLeastOneCommit() { }) } -func (self *Assert) MatchHeadCommitMessage(matcher *matcher) { +func (self *Assert) HeadCommitMessage(matcher *matcher) { self.assertWithRetries(func() (bool, string) { return len(self.gui.Model().Commits) > 0, "Expected at least one commit to be present" }) @@ -156,7 +156,7 @@ func (self *Assert) InListContext() { }) } -func (self *Assert) MatchSelectedLine(matcher *matcher) { +func (self *Assert) SelectedLine(matcher *matcher) { self.matchString(matcher, "Unexpected selected line.", func() string { return self.gui.CurrentContext().GetView().SelectedLine() @@ -199,7 +199,7 @@ func (self *Assert) NotInPopup() { }) } -func (self *Assert) MatchCurrentViewTitle(matcher *matcher) { +func (self *Assert) CurrentViewTitle(matcher *matcher) { self.matchString(matcher, "Unexpected current view title.", func() string { return self.gui.CurrentContext().GetView().Title @@ -207,7 +207,7 @@ func (self *Assert) MatchCurrentViewTitle(matcher *matcher) { ) } -func (self *Assert) MatchViewContent(viewName string, matcher *matcher) { +func (self *Assert) ViewContent(viewName string, matcher *matcher) { self.matchString(matcher, fmt.Sprintf("Unexpected content in view '%s'.", viewName), func() string { return self.gui.View(viewName).Buffer() @@ -215,7 +215,7 @@ func (self *Assert) MatchViewContent(viewName string, matcher *matcher) { ) } -func (self *Assert) MatchCurrentViewContent(matcher *matcher) { +func (self *Assert) CurrentViewContent(matcher *matcher) { self.matchString(matcher, "Unexpected content in current view.", func() string { return self.gui.CurrentContext().GetView().Buffer() @@ -223,7 +223,7 @@ func (self *Assert) MatchCurrentViewContent(matcher *matcher) { ) } -func (self *Assert) MatchMainViewContent(matcher *matcher) { +func (self *Assert) MainViewContent(matcher *matcher) { self.matchString(matcher, "Unexpected main view content.", func() string { return self.gui.MainView().Buffer() @@ -231,7 +231,7 @@ func (self *Assert) MatchMainViewContent(matcher *matcher) { ) } -func (self *Assert) MatchSecondaryViewContent(matcher *matcher) { +func (self *Assert) SecondaryViewContent(matcher *matcher) { self.matchString(matcher, "Unexpected secondary view title.", func() string { return self.gui.SecondaryView().Buffer() diff --git a/pkg/integration/components/input.go b/pkg/integration/components/input.go index 61b0f771f..adc4df261 100644 --- a/pkg/integration/components/input.go +++ b/pkg/integration/components/input.go @@ -78,7 +78,7 @@ func (self *Input) Confirm() { func (self *Input) ProceedWhenAsked(matcher *matcher) { self.assert.InConfirm() - self.assert.MatchCurrentViewContent(matcher) + self.assert.CurrentViewContent(matcher) self.Confirm() } @@ -109,7 +109,7 @@ func (self *Input) PreviousItem() { func (self *Input) ContinueMerge() { self.PressKeys(self.keys.Universal.CreateRebaseOptionsMenu) - self.assert.MatchSelectedLine(Contains("continue")) + self.assert.SelectedLine(Contains("continue")) self.Confirm() } @@ -171,20 +171,20 @@ func (self *Input) NavigateToListItemContainingText(text string) { selectedLineIdx := view.SelectedLineIdx() if selectedLineIdx == matchIndex { - self.assert.MatchSelectedLine(Contains(text)) + self.assert.SelectedLine(Contains(text)) return } if selectedLineIdx < matchIndex { for i := selectedLineIdx; i < matchIndex; i++ { self.NextItem() } - self.assert.MatchSelectedLine(Contains(text)) + self.assert.SelectedLine(Contains(text)) return } else { for i := selectedLineIdx; i > matchIndex; i-- { self.PreviousItem() } - self.assert.MatchSelectedLine(Contains(text)) + self.assert.SelectedLine(Contains(text)) return } } diff --git a/pkg/integration/tests/bisect/basic.go b/pkg/integration/tests/bisect/basic.go index 0c9494b82..0b81bbcb3 100644 --- a/pkg/integration/tests/bisect/basic.go +++ b/pkg/integration/tests/bisect/basic.go @@ -26,16 +26,16 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ } markCommitAsBad := func() { viewBisectOptions() - assert.MatchSelectedLine(Contains("bad")) + assert.SelectedLine(Contains("bad")) input.Confirm() } markCommitAsGood := func() { viewBisectOptions() - assert.MatchSelectedLine(Contains("bad")) + assert.SelectedLine(Contains("bad")) input.NextItem() - assert.MatchSelectedLine(Contains("good")) + assert.SelectedLine(Contains("good")) input.Confirm() } @@ -44,16 +44,16 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToCommitsWindow() - assert.MatchSelectedLine(Contains("commit 10")) + assert.SelectedLine(Contains("commit 10")) input.NavigateToListItemContainingText("commit 09") markCommitAsBad() - assert.MatchViewContent("information", Contains("bisecting")) + assert.ViewContent("information", Contains("bisecting")) assert.CurrentViewName("commits") - assert.MatchSelectedLine(Contains("<-- bad")) + assert.SelectedLine(Contains("<-- bad")) input.NavigateToListItemContainingText("commit 02") @@ -61,26 +61,26 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ // lazygit will land us in the comit between our good and bad commits. assert.CurrentViewName("commits") - assert.MatchSelectedLine(Contains("commit 05")) - assert.MatchSelectedLine(Contains("<-- current")) + assert.SelectedLine(Contains("commit 05")) + assert.SelectedLine(Contains("<-- current")) markCommitAsBad() assert.CurrentViewName("commits") - assert.MatchSelectedLine(Contains("commit 04")) - assert.MatchSelectedLine(Contains("<-- current")) + assert.SelectedLine(Contains("commit 04")) + assert.SelectedLine(Contains("<-- current")) markCommitAsGood() assert.InAlert() - assert.MatchCurrentViewContent(Contains("Bisect complete!")) + assert.CurrentViewContent(Contains("Bisect complete!")) // commit 5 is the culprit because we marked 4 as good and 5 as bad. - assert.MatchCurrentViewContent(Contains("commit 05")) - assert.MatchCurrentViewContent(Contains("Do you want to reset")) + assert.CurrentViewContent(Contains("commit 05")) + assert.CurrentViewContent(Contains("Do you want to reset")) input.Confirm() assert.CurrentViewName("commits") - assert.MatchCurrentViewContent(Contains("commit 04")) - assert.MatchViewContent("information", NotContains("bisecting")) + assert.CurrentViewContent(Contains("commit 04")) + assert.ViewContent("information", NotContains("bisecting")) }, }) diff --git a/pkg/integration/tests/bisect/from_other_branch.go b/pkg/integration/tests/bisect/from_other_branch.go index 4ef9a4d73..52314518f 100644 --- a/pkg/integration/tests/bisect/from_other_branch.go +++ b/pkg/integration/tests/bisect/from_other_branch.go @@ -31,39 +31,39 @@ var FromOtherBranch = NewIntegrationTest(NewIntegrationTestArgs{ markCommitAsGood := func() { viewBisectOptions() - assert.MatchSelectedLine(Contains("bad")) + assert.SelectedLine(Contains("bad")) input.NextItem() - assert.MatchSelectedLine(Contains("good")) + assert.SelectedLine(Contains("good")) input.Confirm() } - assert.MatchViewContent("information", Contains("bisecting")) + assert.ViewContent("information", Contains("bisecting")) assert.AtLeastOneCommit() input.SwitchToCommitsWindow() - assert.MatchSelectedLine(Contains("<-- bad")) - assert.MatchSelectedLine(Contains("commit 08")) + assert.SelectedLine(Contains("<-- bad")) + assert.SelectedLine(Contains("commit 08")) input.NextItem() - assert.MatchSelectedLine(Contains("<-- current")) - assert.MatchSelectedLine(Contains("commit 07")) + assert.SelectedLine(Contains("<-- current")) + assert.SelectedLine(Contains("commit 07")) markCommitAsGood() assert.InAlert() - assert.MatchCurrentViewContent(Contains("Bisect complete!")) - assert.MatchCurrentViewContent(Contains("commit 08")) - assert.MatchCurrentViewContent(Contains("Do you want to reset")) + assert.CurrentViewContent(Contains("Bisect complete!")) + assert.CurrentViewContent(Contains("commit 08")) + assert.CurrentViewContent(Contains("Do you want to reset")) input.Confirm() - assert.MatchViewContent("information", NotContains("bisecting")) + assert.ViewContent("information", NotContains("bisecting")) // back in master branch which just had the one commit assert.CurrentViewName("commits") assert.CommitCount(1) - assert.MatchSelectedLine(Contains("only commit on master")) + assert.SelectedLine(Contains("only commit on master")) }, }) diff --git a/pkg/integration/tests/branch/checkout_by_name.go b/pkg/integration/tests/branch/checkout_by_name.go index 4888b0112..956a2c36b 100644 --- a/pkg/integration/tests/branch/checkout_by_name.go +++ b/pkg/integration/tests/branch/checkout_by_name.go @@ -21,19 +21,19 @@ var CheckoutByName = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToBranchesWindow() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("master")) + assert.SelectedLine(Contains("master")) input.NextItem() - assert.MatchSelectedLine(Contains("@")) + assert.SelectedLine(Contains("@")) input.PressKeys(keys.Branches.CheckoutBranchByName) assert.InPrompt() - assert.MatchCurrentViewTitle(Equals("Branch name:")) + assert.CurrentViewTitle(Equals("Branch name:")) input.Type("new-branch") input.Confirm() assert.InAlert() - assert.MatchCurrentViewContent(Equals("Branch not found. Create a new branch named new-branch?")) + assert.CurrentViewContent(Equals("Branch not found. Create a new branch named new-branch?")) input.Confirm() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("new-branch")) + assert.SelectedLine(Contains("new-branch")) }, }) diff --git a/pkg/integration/tests/branch/delete.go b/pkg/integration/tests/branch/delete.go index 46df9a457..148544563 100644 --- a/pkg/integration/tests/branch/delete.go +++ b/pkg/integration/tests/branch/delete.go @@ -20,21 +20,21 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToBranchesWindow() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("branch-two")) + assert.SelectedLine(Contains("branch-two")) input.PressKeys(keys.Universal.Remove) assert.InAlert() - assert.MatchCurrentViewContent(Contains("You cannot delete the checked out branch!")) + assert.CurrentViewContent(Contains("You cannot delete the checked out branch!")) input.Confirm() input.NextItem() - assert.MatchSelectedLine(Contains("branch-one")) + assert.SelectedLine(Contains("branch-one")) input.PressKeys(keys.Universal.Remove) assert.InConfirm() - assert.MatchCurrentViewContent(Contains("Are you sure you want to delete the branch 'branch-one'?")) + assert.CurrentViewContent(Contains("Are you sure you want to delete the branch 'branch-one'?")) input.Confirm() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("master")) - assert.MatchCurrentViewContent(NotContains("branch-one")) + assert.SelectedLine(Contains("master")) + assert.CurrentViewContent(NotContains("branch-one")) }, }) diff --git a/pkg/integration/tests/branch/rebase.go b/pkg/integration/tests/branch/rebase.go index f894c42cb..a398b0993 100644 --- a/pkg/integration/tests/branch/rebase.go +++ b/pkg/integration/tests/branch/rebase.go @@ -18,21 +18,21 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToBranchesWindow() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("first-change-branch")) + assert.SelectedLine(Contains("first-change-branch")) input.NextItem() - assert.MatchSelectedLine(Contains("second-change-branch")) + assert.SelectedLine(Contains("second-change-branch")) input.PressKeys(keys.Branches.RebaseBranch) assert.InConfirm() - assert.MatchCurrentViewContent(Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?")) + assert.CurrentViewContent(Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?")) input.Confirm() assert.InConfirm() - assert.MatchCurrentViewContent(Contains("Conflicts!")) + assert.CurrentViewContent(Contains("Conflicts!")) input.Confirm() assert.CurrentViewName("files") - assert.MatchSelectedLine(Contains("file")) + assert.SelectedLine(Contains("file")) // not using Confirm() convenience method because I suspect we might change this // keybinding to something more bespoke @@ -41,13 +41,13 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{ assert.CurrentViewName("mergeConflicts") input.PrimaryAction() - assert.MatchViewContent("information", Contains("rebasing")) + assert.ViewContent("information", Contains("rebasing")) assert.InConfirm() - assert.MatchCurrentViewContent(Contains("all merge conflicts resolved. Continue?")) + assert.CurrentViewContent(Contains("all merge conflicts resolved. Continue?")) input.Confirm() - assert.MatchViewContent("information", NotContains("rebasing")) + assert.ViewContent("information", NotContains("rebasing")) // this proves we actually have integrated the changes from second-change-branch - assert.MatchViewContent("commits", Contains("second-change-branch unrelated change")) + assert.ViewContent("commits", Contains("second-change-branch unrelated change")) }, }) diff --git a/pkg/integration/tests/branch/rebase_and_drop.go b/pkg/integration/tests/branch/rebase_and_drop.go index 5600997b3..2269f0292 100644 --- a/pkg/integration/tests/branch/rebase_and_drop.go +++ b/pkg/integration/tests/branch/rebase_and_drop.go @@ -21,30 +21,30 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToBranchesWindow() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("first-change-branch")) + assert.SelectedLine(Contains("first-change-branch")) input.NextItem() - assert.MatchSelectedLine(Contains("second-change-branch")) + assert.SelectedLine(Contains("second-change-branch")) input.PressKeys(keys.Branches.RebaseBranch) assert.InConfirm() - assert.MatchCurrentViewContent(Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?")) + assert.CurrentViewContent(Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?")) input.Confirm() - assert.MatchViewContent("information", Contains("rebasing")) + assert.ViewContent("information", Contains("rebasing")) assert.InConfirm() - assert.MatchCurrentViewContent(Contains("Conflicts!")) + assert.CurrentViewContent(Contains("Conflicts!")) input.Confirm() assert.CurrentViewName("files") - assert.MatchSelectedLine(Contains("file")) + assert.SelectedLine(Contains("file")) input.SwitchToCommitsWindow() - assert.MatchSelectedLine(Contains("pick")) // this means it's a rebasing commit + assert.SelectedLine(Contains("pick")) // this means it's a rebasing commit input.NextItem() input.PressKeys(keys.Universal.Remove) - assert.MatchSelectedLine(Contains("to remove")) - assert.MatchSelectedLine(Contains("drop")) + assert.SelectedLine(Contains("to remove")) + assert.SelectedLine(Contains("drop")) input.SwitchToFilesWindow() @@ -56,14 +56,14 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{ input.PrimaryAction() assert.InConfirm() - assert.MatchCurrentViewContent(Contains("all merge conflicts resolved. Continue?")) + assert.CurrentViewContent(Contains("all merge conflicts resolved. Continue?")) input.Confirm() - assert.MatchViewContent("information", NotContains("rebasing")) + assert.ViewContent("information", NotContains("rebasing")) // this proves we actually have integrated the changes from second-change-branch - assert.MatchViewContent("commits", Contains("second-change-branch unrelated change")) - assert.MatchViewContent("commits", Contains("to keep")) - assert.MatchViewContent("commits", NotContains("to remove")) + assert.ViewContent("commits", Contains("second-change-branch unrelated change")) + assert.ViewContent("commits", Contains("to keep")) + assert.ViewContent("commits", NotContains("to remove")) }, }) diff --git a/pkg/integration/tests/branch/reset.go b/pkg/integration/tests/branch/reset.go index 344c1b821..605b7e76c 100644 --- a/pkg/integration/tests/branch/reset.go +++ b/pkg/integration/tests/branch/reset.go @@ -24,19 +24,19 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToBranchesWindow() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("current-branch")) + assert.SelectedLine(Contains("current-branch")) input.NextItem() - assert.MatchSelectedLine(Contains("other-branch")) + assert.SelectedLine(Contains("other-branch")) input.PressKeys(keys.Commits.ViewResetOptions) assert.InMenu() - assert.MatchCurrentViewTitle(Contains("reset to other-branch")) + assert.CurrentViewTitle(Contains("reset to other-branch")) - assert.MatchSelectedLine(Contains("soft reset")) + assert.SelectedLine(Contains("soft reset")) input.NextItem() - assert.MatchSelectedLine(Contains("mixed reset")) + assert.SelectedLine(Contains("mixed reset")) input.NextItem() - assert.MatchSelectedLine(Contains("hard reset")) + assert.SelectedLine(Contains("hard reset")) input.Confirm() @@ -47,8 +47,8 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToCommitsWindow() assert.CurrentViewName("commits") assert.CommitCount(2) - assert.MatchSelectedLine(Contains("other-branch commit")) + assert.SelectedLine(Contains("other-branch commit")) input.NextItem() - assert.MatchSelectedLine(Contains("root commit")) + assert.SelectedLine(Contains("root commit")) }, }) diff --git a/pkg/integration/tests/branch/suggestions.go b/pkg/integration/tests/branch/suggestions.go index 7f7f7e8cb..346c471d0 100644 --- a/pkg/integration/tests/branch/suggestions.go +++ b/pkg/integration/tests/branch/suggestions.go @@ -34,7 +34,7 @@ var Suggestions = NewIntegrationTest(NewIntegrationTestArgs{ // we expect the first suggestion to be the branch we want because it most // closely matches what we typed in - assert.MatchSelectedLine(Contains("branch-to-checkout")) + assert.SelectedLine(Contains("branch-to-checkout")) input.Confirm() assert.CurrentBranchName("branch-to-checkout") diff --git a/pkg/integration/tests/cherry_pick/cherry_pick.go b/pkg/integration/tests/cherry_pick/cherry_pick.go index 0f5715434..7cbf6a70a 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick.go @@ -27,40 +27,40 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToBranchesWindow() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("first-branch")) + assert.SelectedLine(Contains("first-branch")) input.NextItem() - assert.MatchSelectedLine(Contains("second-branch")) + assert.SelectedLine(Contains("second-branch")) input.Enter() assert.CurrentViewName("subCommits") - assert.MatchSelectedLine(Contains("four")) + assert.SelectedLine(Contains("four")) input.PressKeys(keys.Commits.CherryPickCopy) - assert.MatchViewContent("information", Contains("1 commit copied")) + assert.ViewContent("information", Contains("1 commit copied")) input.NextItem() - assert.MatchSelectedLine(Contains("three")) + assert.SelectedLine(Contains("three")) input.PressKeys(keys.Commits.CherryPickCopy) - assert.MatchViewContent("information", Contains("2 commits copied")) + assert.ViewContent("information", Contains("2 commits copied")) input.SwitchToCommitsWindow() assert.CurrentViewName("commits") - assert.MatchSelectedLine(Contains("two")) + assert.SelectedLine(Contains("two")) input.PressKeys(keys.Commits.PasteCommits) assert.InAlert() - assert.MatchCurrentViewContent(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")) + assert.CurrentViewContent(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")) input.Confirm() assert.CurrentViewName("commits") - assert.MatchSelectedLine(Contains("four")) + assert.SelectedLine(Contains("four")) input.NextItem() - assert.MatchSelectedLine(Contains("three")) + assert.SelectedLine(Contains("three")) input.NextItem() - assert.MatchSelectedLine(Contains("two")) + assert.SelectedLine(Contains("two")) - assert.MatchViewContent("information", Contains("2 commits copied")) + assert.ViewContent("information", Contains("2 commits copied")) input.PressKeys(keys.Universal.Return) - assert.MatchViewContent("information", NotContains("commits copied")) + assert.ViewContent("information", NotContains("commits copied")) }, }) diff --git a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go index e747d8e4d..99005ad8e 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go @@ -18,37 +18,37 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToBranchesWindow() assert.CurrentViewName("localBranches") - assert.MatchSelectedLine(Contains("first-change-branch")) + assert.SelectedLine(Contains("first-change-branch")) input.NextItem() - assert.MatchSelectedLine(Contains("second-change-branch")) + assert.SelectedLine(Contains("second-change-branch")) input.Enter() assert.CurrentViewName("subCommits") - assert.MatchSelectedLine(Contains("second-change-branch unrelated change")) + assert.SelectedLine(Contains("second-change-branch unrelated change")) input.PressKeys(keys.Commits.CherryPickCopy) - assert.MatchViewContent("information", Contains("1 commit copied")) + assert.ViewContent("information", Contains("1 commit copied")) input.NextItem() - assert.MatchSelectedLine(Contains("second change")) + assert.SelectedLine(Contains("second change")) input.PressKeys(keys.Commits.CherryPickCopy) - assert.MatchViewContent("information", Contains("2 commits copied")) + assert.ViewContent("information", Contains("2 commits copied")) input.SwitchToCommitsWindow() assert.CurrentViewName("commits") - assert.MatchSelectedLine(Contains("first change")) + assert.SelectedLine(Contains("first change")) input.PressKeys(keys.Commits.PasteCommits) assert.InAlert() - assert.MatchCurrentViewContent(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")) |