1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-07 13:42:01 +02:00

Add tests for scroll-off margin of zero

This commit is contained in:
Stefan Haller 2023-08-16 17:49:08 +02:00
parent 51d9f70f9e
commit 527a1596f3

View File

@ -52,6 +52,15 @@ func Test_calculateLinesToScrollUp(t *testing.T) {
lineIdxAfter: 12,
expectedLinesToScroll: 1,
},
{
name: "scroll-off margin is zero - scroll by 1 at end of view",
viewPortStart: 10,
viewPortHeight: 10,
scrollOffMargin: 0,
lineIdxBefore: 10,
lineIdxAfter: 9,
expectedLinesToScroll: 1,
},
{
name: "before inside scroll-off margin - scroll by more than 1",
viewPortStart: 10,
@ -134,6 +143,15 @@ func Test_calculateLinesToScrollDown(t *testing.T) {
lineIdxAfter: 17,
expectedLinesToScroll: 1,
},
{
name: "scroll-off margin is zero - scroll by 1 at end of view",
viewPortStart: 10,
viewPortHeight: 10,
scrollOffMargin: 0,
lineIdxBefore: 19,
lineIdxAfter: 20,
expectedLinesToScroll: 1,
},
{
name: "before inside scroll-off margin - scroll by more than 1",
viewPortStart: 10,