diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-11 15:17:52 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-11 17:07:49 +1000 |
commit | 069c7c9d3583c15aea34c08ff7c8be299c94f60d (patch) | |
tree | 624a10165109c8b0feac07f31741605d1bee8de9 | |
parent | 393ce0586056836a48d9122157991d0800afb2f5 (diff) |
fix test
-rw-r--r-- | pkg/commands/pull_request_test.go | 16 | ||||
-rw-r--r-- | pkg/gui/global_handlers.go | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/pkg/commands/pull_request_test.go b/pkg/commands/pull_request_test.go index 278384e80..eb9b173ae 100644 --- a/pkg/commands/pull_request_test.go +++ b/pkg/commands/pull_request_test.go @@ -51,7 +51,7 @@ func TestCreatePullRequest(t *testing.T) { branch *models.Branch remoteUrl string command func(string, ...string) *exec.Cmd - test func(err error) + test func(url string, err error) } scenarios := []scenario{ @@ -71,8 +71,9 @@ func TestCreatePullRequest(t *testing.T) { assert.Equal(t, args, []string{"https://bitbucket.org/johndoe/social_network/pull-requests/new?source=feature/profile-page&t=1"}) return secureexec.Command("echo") }, - test: func(err error) { + test: func(url string, err error) { assert.NoError(t, err) + assert.Equal(t, "https://bitbucket.org/johndoe/social_network/pull-requests/new?source=feature/profile-page&t=1", url) }, }, { @@ -91,8 +92,9 @@ func TestCreatePullRequest(t *testing.T) { assert.Equal(t, args, []string{"https://bitbucket.org/johndoe/social_network/pull-requests/new?source=feature/events&t=1"}) return secureexec.Command("echo") }, - test: func(err error) { + test: func(url string, err error) { assert.NoError(t, err) + assert.Equal(t, "https://bitbucket.org/johndoe/social_network/pull-requests/new?source=feature/events&t=1", url) }, }, { @@ -111,8 +113,9 @@ func TestCreatePullRequest(t *testing.T) { assert.Equal(t, args, []string{"https://github.com/peter/calculator/compare/feature/sum-operation?expand=1"}) return secureexec.Command("echo") }, - test: func(err error) { + test: func(url string, err error) { assert.NoError(t, err) + assert.Equal(t, "https://github.com/peter/calculator/compare/feature/sum-operation?expand=1", url) }, }, { @@ -131,8 +134,9 @@ func TestCreatePullRequest(t *testing.T) { assert.Equal(t, args, []string{"https://gitlab.com/peter/calculator/merge_requests/new?merge_request[source_branch]=feature/ui"}) return secureexec.Command("echo") }, - test: func(err error) { + test: func(url string, err error) { assert.NoError(t, err) + assert.Equal(t, "https://gitlab.com/peter/calculator/merge_requests/new?merge_request[source_branch]=feature/ui", url) }, }, { @@ -144,7 +148,7 @@ func TestCreatePullRequest(t *testing.T) { command: func(cmd string, args ...string) *exec.Cmd { return secureexec.Command("echo") }, - test: func(err error) { + test: func(url string, err error) { assert.Error(t, err) }, }, diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go index 2531c3588..eee09a546 100644 --- a/pkg/gui/global_handlers.go +++ b/pkg/gui/global_handlers.go @@ -112,10 +112,6 @@ func (gui *Gui) linesToScrollDown(view *gocui.View) int { } } -func (gui *Gui) atScrollBottom(view *gocui.View) bool { - return gui.linesToScrollDown(view) == 0 -} - func (gui *Gui) scrollUpMain() error { if gui.canScrollMergePanel() { gui.State.Panels.Merging.UserScrolling = true |