diff --git a/pkg/integration/components/alert_asserter.go b/pkg/integration/components/alert_asserter.go index c2b85848a..9dc2d32ab 100644 --- a/pkg/integration/components/alert_asserter.go +++ b/pkg/integration/components/alert_asserter.go @@ -8,7 +8,7 @@ type AlertAsserter struct { } func (self *AlertAsserter) getViewAsserter() *ViewAsserter { - return self.assert.View("confirmation") + return self.assert.Views().ByName("confirmation") } // asserts that the alert view has the expected title diff --git a/pkg/integration/components/assert.go b/pkg/integration/components/assert.go index ac6b99f0e..b4be669c5 100644 --- a/pkg/integration/components/assert.go +++ b/pkg/integration/components/assert.go @@ -182,34 +182,44 @@ func (self *Assert) FileSystemPathNotPresent(path string) { }) } -func (self *Assert) CurrentView() *ViewAsserter { +func (self *Assert) Views() *ViewAsserterGetter { + return &ViewAsserterGetter{ + assert: self, + } +} + +type ViewAsserterGetter struct { + assert *Assert +} + +func (self *ViewAsserterGetter) Current() *ViewAsserter { return &ViewAsserter{ context: "current view", - getView: func() *gocui.View { return self.gui.CurrentContext().GetView() }, - assert: self, + getView: func() *gocui.View { return self.assert.gui.CurrentContext().GetView() }, + assert: self.assert, } } -func (self *Assert) View(viewName string) *ViewAsserter { - return &ViewAsserter{ - context: fmt.Sprintf("%s view", viewName), - getView: func() *gocui.View { return self.gui.View(viewName) }, - assert: self, - } -} - -func (self *Assert) MainView() *ViewAsserter { +func (self *ViewAsserterGetter) Main() *ViewAsserter { return &ViewAsserter{ context: "main view", - getView: func() *gocui.View { return self.gui.MainView() }, - assert: self, + getView: func() *gocui.View { return self.assert.gui.MainView() }, + assert: self.assert, } } -func (self *Assert) SecondaryView() *ViewAsserter { +func (self *ViewAsserterGetter) Secondary() *ViewAsserter { return &ViewAsserter{ context: "secondary view", - getView: func() *gocui.View { return self.gui.SecondaryView() }, - assert: self, + getView: func() *gocui.View { return self.assert.gui.SecondaryView() }, + assert: self.assert, + } +} + +func (self *ViewAsserterGetter) ByName(viewName string) *ViewAsserter { + return &ViewAsserter{ + context: fmt.Sprintf("%s view", viewName), + getView: func() *gocui.View { return self.assert.gui.View(viewName) }, + assert: self.assert, } } diff --git a/pkg/integration/components/commit_message_panel_asserter.go b/pkg/integration/components/commit_message_panel_asserter.go index f7923282e..6ffb6b80c 100644 --- a/pkg/integration/components/commit_message_panel_asserter.go +++ b/pkg/integration/components/commit_message_panel_asserter.go @@ -6,7 +6,7 @@ type CommitMessagePanelAsserter struct { } func (self *CommitMessagePanelAsserter) getViewAsserter() *ViewAsserter { - return self.assert.View("commitMessage") + return self.assert.Views().ByName("commitMessage") } // asserts on the text initially present in the prompt diff --git a/pkg/integration/components/confirmation_asserter.go b/pkg/integration/components/confirmation_asserter.go index c0ff9246a..371e46028 100644 --- a/pkg/integration/components/confirmation_asserter.go +++ b/pkg/integration/components/confirmation_asserter.go @@ -8,7 +8,7 @@ type ConfirmationAsserter struct { } func (self *ConfirmationAsserter) getViewAsserter() *ViewAsserter { - return self.assert.View("confirmation") + return self.assert.Views().ByName("confirmation") } // asserts that the confirmation view has the expected title diff --git a/pkg/integration/components/input.go b/pkg/integration/components/input.go index c5d808588..014a74d5d 100644 --- a/pkg/integration/components/input.go +++ b/pkg/integration/components/input.go @@ -48,7 +48,7 @@ func (self *Input) SwitchToStatusWindow() { // switch to status window and assert that the status view is on top func (self *Input) SwitchToStatusView() { self.SwitchToStatusWindow() - self.assert.CurrentView().Name("status") + self.assert.Views().Current().Name("status") } func (self *Input) SwitchToFilesWindow() { @@ -59,7 +59,7 @@ func (self *Input) SwitchToFilesWindow() { // switch to files window and assert that the files view is on top func (self *Input) SwitchToFilesView() { self.SwitchToFilesWindow() - self.assert.CurrentView().Name("files") + self.assert.Views().Current().Name("files") } func (self *Input) SwitchToBranchesWindow() { @@ -70,7 +70,7 @@ func (self *Input) SwitchToBranchesWindow() { // switch to branches window and assert that the branches view is on top func (self *Input) SwitchToBranchesView() { self.SwitchToBranchesWindow() - self.assert.CurrentView().Name("localBranches") + self.assert.Views().Current().Name("localBranches") } func (self *Input) SwitchToCommitsWindow() { @@ -81,7 +81,7 @@ func (self *Input) SwitchToCommitsWindow() { // switch to commits window and assert that the commits view is on top func (self *Input) SwitchToCommitsView() { self.SwitchToCommitsWindow() - self.assert.CurrentView().Name("commits") + self.assert.Views().Current().Name("commits") } func (self *Input) SwitchToStashWindow() { @@ -92,7 +92,7 @@ func (self *Input) SwitchToStashWindow() { // switch to stash window and assert that the stash view is on top func (self *Input) SwitchToStashView() { self.SwitchToStashWindow() - self.assert.CurrentView().Name("stash") + self.assert.Views().Current().Name("stash") } func (self *Input) Type(content string) { @@ -133,7 +133,7 @@ func (self *Input) PreviousItem() { func (self *Input) ContinueMerge() { self.Press(self.keys.Universal.CreateRebaseOptionsMenu) - self.assert.CurrentView().SelectedLine(Contains("continue")) + self.assert.Views().Current().SelectedLine(Contains("continue")) self.Confirm() } @@ -197,20 +197,20 @@ func (self *Input) NavigateToListItem(matcher *matcher) { selectedLineIdx := view.SelectedLineIdx() if selectedLineIdx == matchIndex { - self.assert.CurrentView().SelectedLine(matcher) + self.assert.Views().Current().SelectedLine(matcher) return } if selectedLineIdx < matchIndex { for i := selectedLineIdx; i < matchIndex; i++ { self.NextItem() } - self.assert.CurrentView().SelectedLine(matcher) + self.assert.Views().Current().SelectedLine(matcher) return } else { for i := selectedLineIdx; i > matchIndex; i-- { self.PreviousItem() } - self.assert.CurrentView().SelectedLine(matcher) + self.assert.Views().Current().SelectedLine(matcher) return } } diff --git a/pkg/integration/components/menu_asserter.go b/pkg/integration/components/menu_asserter.go index 7c5e2e5f9..ab2256320 100644 --- a/pkg/integration/components/menu_asserter.go +++ b/pkg/integration/components/menu_asserter.go @@ -7,7 +7,7 @@ type MenuAsserter struct { } func (self *MenuAsserter) getViewAsserter() *ViewAsserter { - return self.assert.View("menu") + return self.assert.Views().ByName("menu") } // asserts that the popup has the expected title diff --git a/pkg/integration/components/prompt_asserter.go b/pkg/integration/components/prompt_asserter.go index 01d1ed8f7..079cc4d3f 100644 --- a/pkg/integration/components/prompt_asserter.go +++ b/pkg/integration/components/prompt_asserter.go @@ -7,7 +7,7 @@ type PromptAsserter struct { } func (self *PromptAsserter) getViewAsserter() *ViewAsserter { - return self.assert.View("confirmation") + return self.assert.Views().ByName("confirmation") } // asserts that the popup has the expected title @@ -55,27 +55,27 @@ func (self *PromptAsserter) checkNecessaryChecksCompleted() { } func (self *PromptAsserter) SuggestionLines(matchers ...*matcher) *PromptAsserter { - self.assert.View("suggestions").Lines(matchers...) + self.assert.Views().ByName("suggestions").Lines(matchers...) return self } func (self *PromptAsserter) SuggestionTopLines(matchers ...*matcher) *PromptAsserter { - self.assert.View("suggestions").TopLines(matchers...) + self.assert.Views().ByName("suggestions").TopLines(matchers...) return self } func (self *PromptAsserter) SelectFirstSuggestion() *PromptAsserter { self.input.Press(self.input.keys.Universal.TogglePanel) - self.assert.CurrentView().Name("suggestions") + self.assert.Views().Current().Name("suggestions") return self } func (self *PromptAsserter) SelectSuggestion(matcher *matcher) *PromptAsserter { self.input.Press(self.input.keys.Universal.TogglePanel) - self.assert.CurrentView().Name("suggestions") + self.assert.Views().Current().Name("suggestions") self.input.NavigateToListItem(matcher) diff --git a/pkg/integration/tests/bisect/basic.go b/pkg/integration/tests/bisect/basic.go index 86e58b681..7e2a21a61 100644 --- a/pkg/integration/tests/bisect/basic.go +++ b/pkg/integration/tests/bisect/basic.go @@ -34,28 +34,28 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToCommitsView() - assert.CurrentView().SelectedLine(Contains("commit 10")) + assert.Views().Current().SelectedLine(Contains("commit 10")) input.NavigateToListItem(Contains("commit 09")) markCommitAsBad() - assert.View("information").Content(Contains("bisecting")) + assert.Views().ByName("information").Content(Contains("bisecting")) - assert.CurrentView().Name("commits").SelectedLine(Contains("<-- bad")) + assert.Views().Current().Name("commits").SelectedLine(Contains("<-- bad")) input.NavigateToListItem(Contains("commit 02")) markCommitAsGood() // lazygit will land us in the commit between our good and bad commits. - assert.CurrentView(). + assert.Views().Current(). Name("commits"). SelectedLine(Contains("commit 05").Contains("<-- current")) markCommitAsBad() - assert.CurrentView(). + assert.Views().Current(). Name("commits"). SelectedLine(Contains("commit 04").Contains("<-- current")) @@ -64,7 +64,7 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ // commit 5 is the culprit because we marked 4 as good and 5 as bad. input.Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit 05.*Do you want to reset")).Confirm() - assert.CurrentView().Name("commits").Content(Contains("commit 04")) - assert.View("information").Content(DoesNotContain("bisecting")) + assert.Views().Current().Name("commits").Content(Contains("commit 04")) + assert.Views().ByName("information").Content(DoesNotContain("bisecting")) }, }) diff --git a/pkg/integration/tests/bisect/from_other_branch.go b/pkg/integration/tests/bisect/from_other_branch.go index 40308246e..255b39542 100644 --- a/pkg/integration/tests/bisect/from_other_branch.go +++ b/pkg/integration/tests/bisect/from_other_branch.go @@ -24,13 +24,13 @@ var FromOtherBranch = NewIntegrationTest(NewIntegrationTestArgs{ assert *Assert, keys config.KeybindingConfig, ) { - assert.View("information").Content(Contains("bisecting")) + assert.Views().ByName("information").Content(Contains("bisecting")) assert.AtLeastOneCommit() input.SwitchToCommitsView() - assert.CurrentView().TopLines( + assert.Views().Current().TopLines( MatchesRegexp(`<-- bad.*commit 08`), MatchesRegexp(`<-- current.*commit 07`), MatchesRegexp(`\?.*commit 06`), @@ -44,10 +44,10 @@ var FromOtherBranch = NewIntegrationTest(NewIntegrationTestArgs{ input.Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit 08.*Do you want to reset")).Confirm() - assert.View("information").Content(DoesNotContain("bisecting")) + assert.Views().ByName("information").Content(DoesNotContain("bisecting")) // back in master branch which just had the one commit - assert.CurrentView().Name("commits").Lines( + assert.Views().Current().Name("commits").Lines( 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 e855b7103..ccf75a831 100644 --- a/pkg/integration/tests/branch/checkout_by_name.go +++ b/pkg/integration/tests/branch/checkout_by_name.go @@ -20,7 +20,7 @@ var CheckoutByName = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToBranchesView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("master"), Contains("@"), ) @@ -32,7 +32,7 @@ var CheckoutByName = NewIntegrationTest(NewIntegrationTestArgs{ input.Alert().Title(Equals("Branch not found")).Content(Equals("Branch not found. Create a new branch named new-branch?")).Confirm() - assert.CurrentView().Name("localBranches"). + assert.Views().Current().Name("localBranches"). Lines( MatchesRegexp(`\*.*new-branch`), Contains("master"), diff --git a/pkg/integration/tests/branch/delete.go b/pkg/integration/tests/branch/delete.go index c28668bb5..08b4e8f62 100644 --- a/pkg/integration/tests/branch/delete.go +++ b/pkg/integration/tests/branch/delete.go @@ -19,7 +19,7 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToBranchesView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( MatchesRegexp(`\*.*branch-two`), MatchesRegexp(`branch-one`), MatchesRegexp(`master`), @@ -36,7 +36,7 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{ Content(Contains("Are you sure you want to delete the branch 'branch-one'?")). Confirm() - assert.CurrentView().Name("localBranches"). + assert.Views().Current().Name("localBranches"). Lines( MatchesRegexp(`\*.*branch-two`), MatchesRegexp(`master`).IsSelected(), diff --git a/pkg/integration/tests/branch/rebase.go b/pkg/integration/tests/branch/rebase.go index e4f03810e..ab3302068 100644 --- a/pkg/integration/tests/branch/rebase.go +++ b/pkg/integration/tests/branch/rebase.go @@ -17,13 +17,13 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToBranchesView() - assert.View("localBranches").Lines( + assert.Views().ByName("localBranches").Lines( Contains("first-change-branch"), Contains("second-change-branch"), Contains("original-branch"), ) - assert.View("commits").TopLines( + assert.Views().ByName("commits").TopLines( Contains("first change"), Contains("original"), ) @@ -40,25 +40,25 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{ Content(Contains("Conflicts!")). Confirm() - assert.CurrentView().Name("files").SelectedLine(Contains("file")) + assert.Views().Current().Name("files").SelectedLine(Contains("file")) // not using Confirm() convenience method because I suspect we might change this // keybinding to something more bespoke input.Press(keys.Universal.Confirm) - assert.CurrentView().Name("mergeConflicts") + assert.Views().Current().Name("mergeConflicts") input.PrimaryAction() - assert.View("information").Content(Contains("rebasing")) + assert.Views().ByName("information").Content(Contains("rebasing")) input.Confirmation(). Title(Equals("continue")). Content(Contains("all merge conflicts resolved. Continue?")). Confirm() - assert.View("information").Content(DoesNotContain("rebasing")) + assert.Views().ByName("information").Content(DoesNotContain("rebasing")) - assert.View("commits").TopLines( + assert.Views().ByName("commits").TopLines( Contains("second-change-branch unrelated change"), Contains("second change"), Contains("original"), diff --git a/pkg/integration/tests/branch/rebase_and_drop.go b/pkg/integration/tests/branch/rebase_and_drop.go index b1cc408ba..1c77dbefc 100644 --- a/pkg/integration/tests/branch/rebase_and_drop.go +++ b/pkg/integration/tests/branch/rebase_and_drop.go @@ -20,13 +20,13 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToBranchesView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("first-change-branch"), Contains("second-change-branch"), Contains("original-branch"), ) - assert.View("commits").TopLines( + assert.Views().ByName("commits").TopLines( Contains("to keep").IsSelected(), Contains("to remove"), Contains("first change"), @@ -41,19 +41,19 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{ Content(Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?")). Confirm() - assert.View("information").Content(Contains("rebasing")) + assert.Views().ByName("information").Content(Contains("rebasing")) input.Confirmation(). Title(Equals("Auto-merge failed")). Content(Contains("Conflicts!")). Confirm() - assert.CurrentView(). + assert.Views().Current(). Name("files"). SelectedLine(MatchesRegexp("UU.*file")) input.SwitchToCommitsView() - assert.CurrentView(). + assert.Views().Current(). TopLines( MatchesRegexp(`pick.*to keep`).IsSelected(), MatchesRegexp(`pick.*to remove`), @@ -65,7 +65,7 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{ input.NextItem() input.Press(keys.Universal.Remove) - assert.CurrentView(). + assert.Views().Current(). TopLines( MatchesRegexp(`pick.*to keep`), MatchesRegexp(`drop.*to remove`).IsSelected(), @@ -80,7 +80,7 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{ // keybinding to something more bespoke input.Press(keys.Universal.Confirm) - assert.CurrentView().Name("mergeConflicts") + assert.Views().Current().Name("mergeConflicts") input.PrimaryAction() input.Confirmation(). @@ -88,9 +88,9 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{ Content(Contains("all merge conflicts resolved. Continue?")). Confirm() - assert.View("information").Content(DoesNotContain("rebasing")) + assert.Views().ByName("information").Content(DoesNotContain("rebasing")) - assert.View("commits").TopLines( + assert.Views().ByName("commits").TopLines( Contains("to keep"), Contains("second-change-branch unrelated change").IsSelected(), Contains("second change"), diff --git a/pkg/integration/tests/branch/reset.go b/pkg/integration/tests/branch/reset.go index 821373934..fec6aea7a 100644 --- a/pkg/integration/tests/branch/reset.go +++ b/pkg/integration/tests/branch/reset.go @@ -21,14 +21,14 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{ shell.EmptyCommit("current-branch commit") }, Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { - assert.View("commits").Lines( + assert.Views().ByName("commits").Lines( Contains("current-branch commit"), Contains("root commit"), ) input.SwitchToBranchesView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("current-branch"), Contains("other-branch"), ) @@ -39,11 +39,11 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{ input.Menu().Title(Contains("reset to other-branch")).Select(Contains("hard reset")).Confirm() // ensure that we've returned from the menu before continuing - assert.CurrentView().Name("localBranches") + assert.Views().Current().Name("localBranches") // assert that we now have the expected commits in the commit panel input.SwitchToCommitsView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("other-branch commit"), Contains("root commit"), ) diff --git a/pkg/integration/tests/cherry_pick/cherry_pick.go b/pkg/integration/tests/cherry_pick/cherry_pick.go index 631685577..f832bfe83 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick.go @@ -26,7 +26,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToBranchesView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("first-branch"), Contains("second-branch"), Contains("master"), @@ -36,7 +36,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ input.Enter() - assert.CurrentView().Name("subCommits").Lines( + assert.Views().Current().Name("subCommits").Lines( Contains("four"), Contains("three"), Contains("base"), @@ -44,14 +44,14 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ // copy commits 'four' and 'three' input.Press(keys.Commits.CherryPickCopy) - assert.View("information").Content(Contains("1 commit copied")) + assert.Views().ByName("information").Content(Contains("1 commit copied")) input.NextItem() input.Press(keys.Commits.CherryPickCopy) - assert.View("information").Content(Contains("2 commits copied")) + assert.Views().ByName("information").Content(Contains("2 commits copied")) input.SwitchToCommitsView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("two"), Contains("one"), Contains("base"), @@ -63,7 +63,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")). Confirm() - assert.CurrentView().Name("commits").Lines( + assert.Views().Current().Name("commits").Lines( Contains("four"), Contains("three"), Contains("two"), @@ -71,8 +71,8 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ Contains("base"), ) - assert.View("information").Content(Contains("2 commits copied")) + assert.Views().ByName("information").Content(Contains("2 commits copied")) input.Press(keys.Universal.Return) - assert.View("information").Content(DoesNotContain("commits copied")) + assert.Views().ByName("information").Content(DoesNotContain("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 8efb94e5d..b0be4b48e 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go @@ -16,7 +16,7 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ }, Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToBranchesView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("first-change-branch"), Contains("second-change-branch"), Contains("original-branch"), @@ -26,21 +26,21 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ input.Enter() - assert.CurrentView().Name("subCommits").TopLines( + assert.Views().Current().Name("subCommits").TopLines( Contains("second-change-branch unrelated change"), Contains("second change"), ) input.Press(keys.Commits.CherryPickCopy) - assert.View("information").Content(Contains("1 commit copied")) + assert.Views().ByName("information").Content(Contains("1 commit copied")) input.NextItem() input.Press(keys.Commits.CherryPickCopy) - assert.View("information").Content(Contains("2 commits copied")) + assert.Views().ByName("information").Content(Contains("2 commits copied")) input.SwitchToCommitsView() - assert.CurrentView().TopLines( + assert.Views().Current().TopLines( Contains("first change"), ) @@ -52,14 +52,14 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ Content(Contains("Conflicts!")). Confirm() - assert.CurrentView().Name("files") - assert.CurrentView().SelectedLine(Contains("file")) + assert.Views().Current().Name("files") + assert.Views().Current().SelectedLine(Contains("file")) // not using Confirm() convenience method because I suspect we might change this // keybinding to something more bespoke input.Press(keys.Universal.Confirm) - assert.CurrentView().Name("mergeConflicts") + assert.Views().Current().Name("mergeConflicts") // picking 'Second change' input.NextItem() input.PrimaryAction() @@ -69,12 +69,12 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ Content(Contains("all merge conflicts resolved. Continue?")). Confirm() - assert.CurrentView().Name("files") + assert.Views().Current().Name("files") assert.WorkingTreeFileCount(0) input.SwitchToCommitsView() - assert.CurrentView().TopLines( + assert.Views().Current().TopLines( Contains("second-change-branch unrelated change"), Contains("second change"), Contains("first change"), @@ -83,12 +83,12 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ // because we picked 'Second change' when resolving the conflict, // we now see this commit as having replaced First Change with Second Change, // as opposed to replacing 'Original' with 'Second change' - assert.MainView(). + assert.Views().Main(). Content(Contains("-First Change")). Content(Contains("+Second Change")) - assert.View("information").Content(Contains("2 commits copied")) + assert.Views().ByName("information").Content(Contains("2 commits copied")) input.Press(keys.Universal.Return) - assert.View("information").Content(DoesNotContain("commits copied")) + assert.Views().ByName("information").Content(DoesNotContain("commits copied")) }, }) diff --git a/pkg/integration/tests/commit/commit_multiline.go b/pkg/integration/tests/commit/commit_multiline.go index 4d6ba883a..eb0723c39 100644 --- a/pkg/integration/tests/commit/commit_multiline.go +++ b/pkg/integration/tests/commit/commit_multiline.go @@ -25,6 +25,6 @@ var CommitMultiline = NewIntegrationTest(NewIntegrationTestArgs{ assert.HeadCommitMessage(Equals("first line")) input.SwitchToCommitsView() - assert.MainView().Content(MatchesRegexp("first line\n\\s*\n\\s*third line")) + assert.Views().Main().Content(MatchesRegexp("first line\n\\s*\n\\s*third line")) }, }) diff --git a/pkg/integration/tests/commit/new_branch.go b/pkg/integration/tests/commit/new_branch.go index c14e48310..a4001df8d 100644 --- a/pkg/integration/tests/commit/new_branch.go +++ b/pkg/integration/tests/commit/new_branch.go @@ -20,7 +20,7 @@ var NewBranch = NewIntegrationTest(NewIntegrationTestArgs{ assert.CommitCount(3) input.SwitchToCommitsView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("commit 3"), Contains("commit 2"), Contains("commit 1"), @@ -34,7 +34,7 @@ var NewBranch = NewIntegrationTest(NewIntegrationTestArgs{ assert.CurrentBranchName(branchName) - assert.View("commits").Lines( + assert.Views().ByName("commits").Lines( Contains("commit 2"), Contains("commit 1"), ) diff --git a/pkg/integration/tests/commit/revert.go b/pkg/integration/tests/commit/revert.go index 9527d5640..5ce7ac12b 100644 --- a/pkg/integration/tests/commit/revert.go +++ b/pkg/integration/tests/commit/revert.go @@ -20,7 +20,7 @@ var Revert = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToCommitsView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("first commit"), ) @@ -30,13 +30,13 @@ var Revert = NewIntegrationTest(NewIntegrationTestArgs{ Content(MatchesRegexp(`Are you sure you want to revert \w+?`)). Confirm() - assert.CurrentView().Name("commits"). + assert.Views().Current().Name("commits"). Lines( Contains("Revert \"first commit\"").IsSelected(), Contains("first commit"), ) - assert.MainView().Content(Contains("-myfile content")) + assert.Views().Main().Content(Contains("-myfile content")) assert.FileSystemPathNotPresent("myfile") }, }) diff --git a/pkg/integration/tests/commit/staged.go b/pkg/integration/tests/commit/staged.go index 4a0c3eafc..7862aaeef 100644 --- a/pkg/integration/tests/commit/staged.go +++ b/pkg/integration/tests/commit/staged.go @@ -18,26 +18,26 @@ var Staged = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { assert.CommitCount(0) - assert.CurrentView().Name("files") - assert.CurrentView().SelectedLine(Contains("myfile")) + assert.Views().Current().Name("files") + assert.Views().Current().SelectedLine(Contains("myfile")) // stage the file input.PrimaryAction() input.Enter() - assert.CurrentView().Name("stagingSecondary") + assert.Views().Current().Name("stagingSecondary") // we start with both lines having been staged - assert.View("stagingSecondary").Content(Contains("+myfile content")) - assert.View("stagingSecondary").Content(Contains("+with a second line")) - assert.View("staging").Content(DoesNotContain("+myfile content")) - assert.View("staging").Content(DoesNotContain("+with a second line")) + assert.Views().ByName("stagingSecondary").Content(Contains("+myfile content")) + assert.Views().ByName("stagingSecondary").Content(Contains("+with a second line")) + assert.Views().ByName("staging").Content(DoesNotContain("+myfile content")) + assert.Views().ByName("staging").Content(DoesNotContain("+with a second line")) // unstage the selected line input.PrimaryAction() // the line should have been moved to the main view - assert.View("stagingSecondary").Content(DoesNotContain("+myfile content")) - assert.View("stagingSecondary").Content(Contains("+with a second line")) - assert.View("staging").Content(Contains("+myfile content")) - assert.View("staging").Content(DoesNotContain("+with a second line")) + assert.Views().ByName("stagingSecondary").Content(DoesNotContain("+myfile content")) + assert.Views().ByName("stagingSecondary").Content(Contains("+with a second line")) + assert.Views().ByName("staging").Content(Contains("+myfile content")) + assert.Views().ByName("staging").Content(DoesNotContain("+with a second line")) input.Press(keys.Files.CommitChanges) commitMessage := "my commit message" diff --git a/pkg/integration/tests/commit/staged_without_hooks.go b/pkg/integration/tests/commit/staged_without_hooks.go index 95fa72e7e..1f41238a3 100644 --- a/pkg/integration/tests/commit/staged_without_hooks.go +++ b/pkg/integration/tests/commit/staged_without_hooks.go @@ -19,16 +19,16 @@ var StagedWithoutHooks = NewIntegrationTest(NewIntegrationTestArgs{ assert.CommitCount(0) // stage the file - assert.CurrentView().Name("files") - assert.CurrentView().SelectedLine(Contains("myfile")) + assert.Views().Current().Name("files") + assert.Views().Current().SelectedLine(Contains("myfile")) input.PrimaryAction() input.Enter() - assert.CurrentView().Name("stagingSecondary") + assert.Views().Current().Name("stagingSecondary") // we start with both lines having been staged - assert.View("stagingSecondary").Content( + assert.Views().ByName("stagingSecondary").Content( Contains("+myfile content").Contains("+with a second line"), ) - assert.View("staging").Content( + assert.Views().ByName("staging").Content( DoesNotContain("+myfile content").DoesNotContain("+with a second line"), ) @@ -36,8 +36,8 @@ var StagedWithoutHooks = NewIntegrationTest(NewIntegrationTestArgs{ input.PrimaryAction() // the line should have been moved to the main view - assert.View("stagingSecondary").Content(DoesNotContain("+myfile content").Contains("+with a second line")) - assert.View("staging").Content(Contains("+myfile content").DoesNotContain("+with a second line")) + assert.Views().ByName("stagingSecondary").Content(DoesNotContain("+myfile content").Contains("+with a second line")) + assert.Views().ByName("staging").Content(Contains("+myfile content").DoesNotContain("+with a second line")) input.Press(keys.Files.CommitChangesWithoutHook) @@ -46,7 +46,7 @@ var StagedWithoutHooks = NewIntegrationTest(NewIntegrationTestArgs{ assert.CommitCount(1) assert.HeadCommitMessage(Equals("WIP" + commitMessage)) - assert.CurrentView().Name("stagingSecondary") + assert.Views().Current().Name("stagingSecondary") // TODO: assert that the staging panel has been refreshed (it currently does not get correctly refreshed) }, diff --git a/pkg/integration/tests/commit/unstaged.go b/pkg/integration/tests/commit/unstaged.go index f46c06a87..9b56c9c43 100644 --- a/pkg/integration/tests/commit/unstaged.go +++ b/pkg/integration/tests/commit/unstaged.go @@ -20,14 +20,14 @@ var Unstaged = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { assert.CommitCount(0) - assert.CurrentView().Name("files").SelectedLine(Contains("myfile")) + assert.Views().Current().Name("files").SelectedLine(Contains("myfile")) input.Enter() - assert.CurrentView().Name("staging") - assert.View("stagingSecondary").Content(DoesNotContain("+myfile content")) + assert.Views().Current().Name("staging") + assert.Views().ByName("stagingSecondary").Content(DoesNotContain("+myfile content")) // stage the first line input.PrimaryAction() - assert.View("staging").Content(DoesNotContain("+myfile content")) - assert.View("stagingSecondary").Content(Contains("+myfile content")) + assert.Views().ByName("staging").Content(DoesNotContain("+myfile content")) + assert.Views().ByName("stagingSecondary").Content(Contains("+myfile content")) input.Press(keys.Files.CommitChanges) diff --git a/pkg/integration/tests/custom_commands/basic.go b/pkg/integration/tests/custom_commands/basic.go index fc3cad569..7fb67aa77 100644 --- a/pkg/integration/tests/custom_commands/basic.go +++ b/pkg/integration/tests/custom_commands/basic.go @@ -31,7 +31,7 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ input.Press("a") - assert.View("files").Lines( + assert.Views().ByName("files").Lines( Contains("myfile"), ) }, diff --git a/pkg/integration/tests/custom_commands/form_prompts.go b/pkg/integration/tests/custom_commands/form_prompts.go index fa6495a93..6778dd7aa 100644 --- a/pkg/integration/tests/custom_commands/form_prompts.go +++ b/pkg/integration/tests/custom_commands/form_prompts.go @@ -75,7 +75,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{ Confirm() assert.WorkingTreeFileCount(1) - assert.CurrentView().SelectedLine(Contains("my file")) - assert.MainView().Content(Contains(`"BAR"`)) + assert.Views().Current().SelectedLine(Contains("my file")) + assert.Views().Main().Content(Contains(`"BAR"`)) }, }) diff --git a/pkg/integration/tests/custom_commands/menu_from_command.go b/pkg/integration/tests/custom_commands/menu_from_command.go index d9b9fab05..7268a0c25 100644 --- a/pkg/integration/tests/custom_commands/menu_from_command.go +++ b/pkg/integration/tests/custom_commands/menu_from_command.go @@ -60,7 +60,7 @@ var MenuFromCommand = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToFilesView() assert.WorkingTreeFileCount(1) - assert.CurrentView().SelectedLine(Contains("output.txt")) - assert.MainView().Content(Contains("bar Branch: #feature/foo my branch feature/foo")) + assert.Views().Current().SelectedLine(Contains("output.txt")) + assert.Views().Main().Content(Contains("bar Branch: #feature/foo my branch feature/foo")) }, }) diff --git a/pkg/integration/tests/custom_commands/menu_from_commands_output.go b/pkg/integration/tests/custom_commands/menu_from_commands_output.go index d17cb1176..f7177f086 100644 --- a/pkg/integration/tests/custom_commands/menu_from_commands_output.go +++ b/pkg/integration/tests/custom_commands/menu_from_commands_output.go @@ -55,7 +55,7 @@ var MenuFromCommandsOutput = NewIntegrationTest(NewIntegrationTestArgs{ input.Press("a") assert.InPrompt() - assert.CurrentView(). + assert.Views().Current(). Title(Equals("Which git command do you want to run?")). SelectedLine(Equals("branch")) input.Confirm() diff --git a/pkg/integration/tests/custom_commands/multiple_prompts.go b/pkg/integration/tests/custom_commands/multiple_prompts.go index 9b77a05bf..ec49a127d 100644 --- a/pkg/integration/tests/custom_commands/multiple_prompts.go +++ b/pkg/integration/tests/custom_commands/multiple_prompts.go @@ -73,7 +73,7 @@ var MultiplePrompts = NewIntegrationTest(NewIntegrationTestArgs{ Confirm() assert.WorkingTreeFileCount(1) - assert.CurrentView().SelectedLine(Contains("myfile")) - assert.MainView().Content(Contains("BAR")) + assert.Views().Current().SelectedLine(Contains("myfile")) + assert.Views().Main().Content(Contains("BAR")) }, }) diff --git a/pkg/integration/tests/diff/diff.go b/pkg/integration/tests/diff/diff.go index e0fc214b2..96484b421 100644 --- a/pkg/integration/tests/diff/diff.go +++ b/pkg/integration/tests/diff/diff.go @@ -24,35 +24,35 @@ var Diff = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToBranchesView() - assert.CurrentView().TopLines( + assert.Views().Current().TopLines( Contains("branch-a"), Contains("branch-b"), ) input.Press(keys.Universal.DiffingMenu) input.Menu().Title(Equals("Diffing")).Select(Contains(`diff branch-a`)).Confirm() - assert.CurrentView().Name("localBranches") + assert.Views().Current().Name("localBranches") - assert.View("information").Content(Contains("showing output for: git diff branch-a branch-a")) + assert.Views().ByName("information").Content(Contains("showing output for: git diff branch-a branch-a")) input.NextItem() - assert.View("information").Content(Contains("showing output for: git diff branch-a branch-b")) - assert.MainView().Content(Contains("+second line")) + assert.Views().ByName("information").Content(Contains("showing output for: git diff branch-a branch-b")) + assert.Views().Main().Content(Contains("+second line")) input.Enter() - assert.CurrentView().Name("subCommits") - assert.MainView().Content(Contains("+second line")) - assert.CurrentView().SelectedLine(Contains("update")) + assert.Views().Current().Name("subCommits") + assert.Views().Main().Content(Contains("+second line")) + assert.Views().Current().SelectedLine(Contains("update")) input.Enter() - assert.CurrentView().Name("commitFiles").SelectedLine(Contains("file1")) - assert.MainView().Content(Contains("+second line")) + assert.Views().Current().Name("commitFiles").SelectedLine(Contains("file1")) + assert.Views().Main().Content(Contains("+second line")) input.Press(keys.Universal.Return) input.Press(keys.Universal.Return) - assert.CurrentView().Name("localBranches") + assert.Views().Current().Name("localBranches") input.Press(keys.Universal.DiffingMenu) input.Menu().Title(Equals("Diffing")).Select(Contains("reverse diff direction")).Confirm() - assert.View("information").Content(Contains("showing output for: git diff branch-a branch-b -R")) - assert.MainView().Content(Contains("-second line")) + assert.Views().ByName("information").Content(Contains("showing output for: git diff branch-a branch-b -R")) + assert.Views().Main().Content(Contains("-second line")) }, }) diff --git a/pkg/integration/tests/diff/diff_and_apply_patch.go b/pkg/integration/tests/diff/diff_and_apply_patch.go index e6dfe5a97..fdcaf0be7 100644 --- a/pkg/integration/tests/diff/diff_and_apply_patch.go +++ b/pkg/integration/tests/diff/diff_and_apply_patch.go @@ -23,7 +23,7 @@ var DiffAndApplyPatch = NewIntegrationTest(NewIntegrationTestArgs{ }, Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToBranchesView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("branch-a"), Contains("branch-b"), ) @@ -32,21 +32,21 @@ var DiffAndApplyPatch = NewIntegrationTest(NewIntegrationTestArgs{ input.Menu().Title(Equals("Diffing")).Select(Equals("diff branch-a")).Confirm() - assert.CurrentView().Name("localBranches") + assert.Views().Current().Name("localBranches") - assert.View("information").Content(Contains("showing output for: git diff branch-a branch-a")) + assert.Views().ByName("information").Content(Contains("showing output for: git diff branch-a branch-a")) input.NextItem() - assert.View("information").Content(Contains("showing output for: git diff branch-a branch-b")) - assert.MainView().Content(Contains("+second line")) + assert.Views().ByName("information").Content(Contains("showing output for: git diff branch-a branch-b")) + assert.Views().Main().Content(Contains("+second line")) input.Enter() - assert.CurrentView().Name("subCommits") - assert.MainView().Content(Contains("+second line")) - assert.CurrentView().SelectedLine(Contains("update")) + assert.Views().Current().Name("subCommits") + assert.Views().Main().Content(Contains("+second line")) + assert.Views().Current().SelectedLine(Contains("update")) input.Enter() - assert.CurrentView().Name("commitFiles") - assert.CurrentView().SelectedLine(Contains("file1")) - assert.MainView().Content(Contains("+second line")) + assert.Views().Current().Name("commitFiles") + assert.Views().Current().SelectedLine(Contains("file1")) + assert.Views().Main().Content(Contains("+second line")) // add the file to the patch input.PrimaryAction() @@ -54,7 +54,7 @@ var DiffAndApplyPatch = NewIntegrationTest(NewIntegrationTestArgs{ input.Press(keys.Universal.DiffingMenu) input.Menu().Title(Equals("Diffing")).Select(Contains("exit diff mode")).Confirm() - assert.View("information").Content(DoesNotContain("building patch")) + assert.Views().ByName("information").Content(DoesNotContain("building patch")) input.Press(keys.Universal.CreatePatchOptionsMenu) // adding the regex '$' here to distinguish the menu item from the 'apply patch in reverse' item @@ -62,7 +62,7 @@ var DiffAndApplyPatch = NewIntegrationTest(NewIntegrationTestArgs{ input.SwitchToFilesView() - assert.CurrentView().SelectedLine(Contains("file1")) - assert.MainView().Content(Contains("+second line")) + assert.Views().Current().SelectedLine(Contains("file1")) + assert.Views().Main().Content(Contains("+second line")) }, }) diff --git a/pkg/integration/tests/diff/diff_commits.go b/pkg/integration/tests/diff/diff_commits.go index e4db05f18..9095c22e8 100644 --- a/pkg/integration/tests/diff/diff_commits.go +++ b/pkg/integration/tests/diff/diff_commits.go @@ -21,7 +21,7 @@ var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToCommitsView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("third commit"), Contains("second commit"), Contains("first commit"), @@ -32,23 +32,23 @@ var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{ assert.NotInPopup() - assert.View("information").Content(Contains("showing output for: git diff")) + assert.Views().ByName("information").Content(Contains("showing output for: git diff")) input.NextItem() input.NextItem() - assert.CurrentView().SelectedLine(Contains("first commit")) + assert.Views().Current().SelectedLine(Contains("first commit")) - assert.MainView().Content(Contains("-second line\n-third line")) + assert.Views().Main().Content(Contains("-second line\n-third line")) input.Press(keys.Universal.DiffingMenu) input.Menu().Title(Equals("Diffing")).Select(Contains("reverse diff direction")).Confirm() assert.NotInPopup() - assert.MainView().Content(Contains("+second line\n+third line")) + assert.Views().Main().Content(Contains("+second line\n+third line")) input.Enter() - assert.CurrentView().Name("commitFiles").SelectedLine(Contains("file1")) - assert.MainView().Content(Contains("+second line\n+third line")) + assert.Views().Current().Name("commitFiles").SelectedLine(Contains("file1")) + assert.Views().Main().Content(Contains("+second line\n+third line")) }, }) diff --git a/pkg/integration/tests/file/dir_with_untracked_file.go b/pkg/integration/tests/file/dir_with_untracked_file.go index b85ea273b..344aa7c91 100644 --- a/pkg/integration/tests/file/dir_with_untracked_file.go +++ b/pkg/integration/tests/file/dir_with_untracked_file.go @@ -24,7 +24,7 @@ var DirWithUntrackedFile = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { assert.CommitCount(1) - assert.MainView(). + assert.Views().Main(). Content(DoesNotContain("error: Could not access")). // we show baz because it's a modified file but we don't show bar because it's untracked // (though it would be cool if we could show that too) diff --git a/pkg/integration/tests/file/discard_changes.go b/pkg/integration/tests/file/discard_changes.go index e965385ec..12324e7c1 100644 --- a/pkg/integration/tests/file/discard_changes.go +++ b/pkg/integration/tests/file/discard_changes.go @@ -82,7 +82,7 @@ var DiscardChanges = NewIntegrationTest(NewIntegrationTestArgs{ discardOneByOne := func(files []statusFile) { for _, file := range files { - assert.CurrentView().SelectedLine(Contains(file.status + " " + file.label)) + assert.Views().Current().SelectedLine(Contains(file.status + " " + file.label)) input.Press(keys.Universal.Remove) input.Menu().Title(Equals(file.menuTitle)).Select(Contains("discard all changes")).Confirm() } diff --git a/pkg/integration/tests/interactive_rebase/amend_merge.go b/pkg/integration/tests/interactive_rebase/amend_merge.go index f1ea39d04..67a90ff6f 100644 --- a/pkg/integration/tests/interactive_rebase/amend_merge.go +++ b/pkg/integration/tests/interactive_rebase/amend_merge.go @@ -46,7 +46,7 @@ var AmendMerge = NewIntegrationTest(NewIntegrationTestArgs{ assert.HeadCommitMessage(Contains(mergeCommitMessage)) // assuring the post-merge file shows up in the merge commit. - assert.MainView(). + assert.Views().Main(). Content(Contains(postMergeFilename)). Content(Contains("++" + postMergeFileContent)) }, diff --git a/pkg/integration/tests/interactive_rebase/one.go b/pkg/integration/tests/interactive_rebase/one.go index 3c4c07a4d..170bcf364 100644 --- a/pkg/integration/tests/interactive_rebase/one.go +++ b/pkg/integration/tests/interactive_rebase/one.go @@ -16,7 +16,7 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{ }, Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToCommitsView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("commit 05"), Contains("commit 04"), Contains("commit 03"), @@ -27,7 +27,7 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{ input.NavigateToListItem(Contains("commit 02")) input.Press(keys.Universal.Edit) - assert.CurrentView().Lines( + assert.Views().Current().Lines( MatchesRegexp("pick.*commit 05"), MatchesRegexp("pick.*commit 04"), MatchesRegexp("pick.*commit 03"), @@ -37,7 +37,7 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{ input.PreviousItem() input.Press(keys.Commits.MarkCommitAsFixup) - assert.CurrentView().Lines( + assert.Views().Current().Lines( MatchesRegexp("pick.*commit 05"), MatchesRegexp("pick.*commit 04"), MatchesRegexp("fixup.*commit 03"), @@ -47,7 +47,7 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{ input.PreviousItem() input.Press(keys.Universal.Remove) - assert.CurrentView().Lines( + assert.Views().Current().Lines( MatchesRegexp("pick.*commit 05"), MatchesRegexp("drop.*commit 04"), MatchesRegexp("fixup.*commit 03"), @@ -58,7 +58,7 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{ input.PreviousItem() input.Press(keys.Commits.SquashDown) - assert.CurrentView().Lines( + assert.Views().Current().Lines( MatchesRegexp("squash.*commit 05"), MatchesRegexp("drop.*commit 04"), MatchesRegexp("fixup.*commit 03"), @@ -68,7 +68,7 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{ input.ContinueRebase() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Contains("commit 02"), Contains("commit 01"), ) diff --git a/pkg/integration/tests/stash/rename.go b/pkg/integration/tests/stash/rename.go index 99036b7f6..443f64a14 100644 --- a/pkg/integration/tests/stash/rename.go +++ b/pkg/integration/tests/stash/rename.go @@ -21,7 +21,7 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { input.SwitchToStashView() - assert.CurrentView().Lines( + assert.Views().Current().Lines( Equals("On master: bar"), Equals("On master: foo"), ) @@ -30,6 +30,6 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{ input.Prompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm() - assert.CurrentView().SelectedLine(Equals("On master: foo baz")) + assert.Views().Current().SelectedLine(Equals("On master: foo baz")) }, })