1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-23 12:18:51 +02:00
This commit is contained in:
Jesse Duffield 2021-04-11 15:17:52 +10:00
parent 393ce05860
commit 069c7c9d35
2 changed files with 10 additions and 10 deletions

View File

@ -51,7 +51,7 @@ func TestCreatePullRequest(t *testing.T) {
branch *models.Branch branch *models.Branch
remoteUrl string remoteUrl string
command func(string, ...string) *exec.Cmd command func(string, ...string) *exec.Cmd
test func(err error) test func(url string, err error)
} }
scenarios := []scenario{ 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"}) assert.Equal(t, args, []string{"https://bitbucket.org/johndoe/social_network/pull-requests/new?source=feature/profile-page&t=1"})
return secureexec.Command("echo") return secureexec.Command("echo")
}, },
test: func(err error) { test: func(url string, err error) {
assert.NoError(t, err) 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"}) assert.Equal(t, args, []string{"https://bitbucket.org/johndoe/social_network/pull-requests/new?source=feature/events&t=1"})
return secureexec.Command("echo") return secureexec.Command("echo")
}, },
test: func(err error) { test: func(url string, err error) {
assert.NoError(t, err) 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"}) assert.Equal(t, args, []string{"https://github.com/peter/calculator/compare/feature/sum-operation?expand=1"})
return secureexec.Command("echo") return secureexec.Command("echo")
}, },
test: func(err error) { test: func(url string, err error) {
assert.NoError(t, err) 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"}) assert.Equal(t, args, []string{"https://gitlab.com/peter/calculator/merge_requests/new?merge_request[source_branch]=feature/ui"})
return secureexec.Command("echo") return secureexec.Command("echo")
}, },
test: func(err error) { test: func(url string, err error) {
assert.NoError(t, err) 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 { command: func(cmd string, args ...string) *exec.Cmd {
return secureexec.Command("echo") return secureexec.Command("echo")
}, },
test: func(err error) { test: func(url string, err error) {
assert.Error(t, err) assert.Error(t, err)
}, },
}, },

View File

@ -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 { func (gui *Gui) scrollUpMain() error {
if gui.canScrollMergePanel() { if gui.canScrollMergePanel() {
gui.State.Panels.Merging.UserScrolling = true gui.State.Panels.Merging.UserScrolling = true