Skip to content

Commit 060e3b2

Browse files
committed
test(popup): add a testcase for relative: cursor
1 parent c3719e6 commit 060e3b2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

popup/mod_test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,29 @@ test({
105105
},
106106
});
107107
}
108+
109+
t.step({
110+
name: `open() with relative cursor`,
111+
fn: async () => {
112+
await denops.cmd("normal! 10G10");
113+
await using popupWindow = await popup.open(denops, {
114+
relative: "cursor",
115+
width: 20,
116+
height: 20,
117+
row: 3,
118+
col: 3,
119+
});
120+
console.log(popupWindow.winid);
121+
assertEquals(await fn.win_gettype(denops, popupWindow.winid), "popup");
122+
assertEquals(await fn.winwidth(denops, popupWindow.winid), 20);
123+
assertEquals(await fn.winheight(denops, popupWindow.winid), 20);
124+
125+
const info = (await fn.getwininfo(denops, popupWindow.winid))[0];
126+
assertEquals(info.winrow, 13);
127+
assertEquals(info.wincol, 13);
128+
129+
await denops.cmd("normal! 0G0");
130+
},
131+
})
108132
},
109133
});

0 commit comments

Comments
 (0)