diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-10 11:54:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-10 11:54:26 +0800 |
commit | ba23d109baa5a863886298fa3590e0258873f2bb (patch) | |
tree | 1780d193532f0d25b0fa132fce333725a10812e0 /test/functional/ui/popupmenu_spec.lua | |
parent | dcb11c1091416db04101dab3566563c74b47452b (diff) | |
download | rneovim-ba23d109baa5a863886298fa3590e0258873f2bb.tar.gz rneovim-ba23d109baa5a863886298fa3590e0258873f2bb.tar.bz2 rneovim-ba23d109baa5a863886298fa3590e0258873f2bb.zip |
test: add test for scroll wheel at right-click menu (#27409)
Diffstat (limited to 'test/functional/ui/popupmenu_spec.lua')
-rw-r--r-- | test/functional/ui/popupmenu_spec.lua | 70 |
1 files changed, 65 insertions, 5 deletions
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 1f7d187016..1f0d20f66d 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -3784,9 +3784,7 @@ describe('builtin popupmenu', function() {n: bar }| {n: baz }| ]], - float_pos = { - [4] = { -1, 'NW', 2, 1, 17, false, 250 }, - }, + float_pos = { [4] = { -1, 'NW', 2, 1, 17, false, 250 } }, } else feed('<RightMouse><18,0>') @@ -3969,7 +3967,38 @@ describe('builtin popupmenu', function() end eq(true, screen.options.mousemoveevent) if multigrid then - api.nvim_input_mouse('move', '', '', 2, 3, 6) + api.nvim_input_mouse('wheel', 'up', '', 2, 0, 4) + screen:expect({ + grid = [[ + ## grid 1 + [2:--------------------------------]|*5 + [3:--------------------------------]| + ## grid 2 + ^popup menu test | + {1:~ }|*4 + ## grid 3 + :let g:menustr = 'foo' | + ## grid 4 + {s: foo }| + {n: bar }| + {n: baz }| + ]], + float_pos = { [4] = { -1, 'NW', 2, 1, 3, false, 250 } }, + }) + else + feed('<ScrollWheelUp><4,0>') + screen:expect([[ + ^popup menu test | + {1:~ }{s: foo }{1: }| + {1:~ }{n: bar }{1: }| + {1:~ }{n: baz }{1: }| + {1:~ }| + :let g:menustr = 'foo' | + ]]) + end + eq(true, screen.options.mousemoveevent) + if multigrid then + api.nvim_input_mouse('move', '', '', 4, 2, 3) screen:expect({ grid = [[ ## grid 1 @@ -4000,7 +4029,38 @@ describe('builtin popupmenu', function() end eq(true, screen.options.mousemoveevent) if multigrid then - api.nvim_input_mouse('left', 'press', '', 2, 2, 6) + api.nvim_input_mouse('wheel', 'down', '', 4, 2, 3) + screen:expect({ + grid = [[ + ## grid 1 + [2:--------------------------------]|*5 + [3:--------------------------------]| + ## grid 2 + ^popup menu test | + {1:~ }|*4 + ## grid 3 + :let g:menustr = 'foo' | + ## grid 4 + {n: foo }| + {s: bar }| + {n: baz }| + ]], + float_pos = { [4] = { -1, 'NW', 2, 1, 3, false, 250 } }, + }) + else + feed('<ScrollWheelDown><6,3>') + screen:expect([[ + ^popup menu test | + {1:~ }{n: foo }{1: }| + {1:~ }{s: bar }{1: }| + {1:~ }{n: baz }{1: }| + {1:~ }| + :let g:menustr = 'foo' | + ]]) + end + eq(true, screen.options.mousemoveevent) + if multigrid then + api.nvim_input_mouse('left', 'press', '', 4, 1, 3) screen:expect({ grid = [[ ## grid 1 |