mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-13 13:59:06 +02:00
Add tests for scroll-off margin of zero
This commit is contained in:
parent
51d9f70f9e
commit
527a1596f3
@ -52,6 +52,15 @@ func Test_calculateLinesToScrollUp(t *testing.T) {
|
|||||||
lineIdxAfter: 12,
|
lineIdxAfter: 12,
|
||||||
expectedLinesToScroll: 1,
|
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",
|
name: "before inside scroll-off margin - scroll by more than 1",
|
||||||
viewPortStart: 10,
|
viewPortStart: 10,
|
||||||
@ -134,6 +143,15 @@ func Test_calculateLinesToScrollDown(t *testing.T) {
|
|||||||
lineIdxAfter: 17,
|
lineIdxAfter: 17,
|
||||||
expectedLinesToScroll: 1,
|
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",
|
name: "before inside scroll-off margin - scroll by more than 1",
|
||||||
viewPortStart: 10,
|
viewPortStart: 10,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user