From b07a6d10f107659dbb061abbfad8188ea9cc75c8 Mon Sep 17 00:00:00 2001 From: Jon Bockhorst Date: Tue, 5 Nov 2019 23:44:30 -0600 Subject: [PATCH] Add test for multiline links --- addons/xterm-addon-web-links/src/WebLinksAddon.api.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts b/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts index 9f2ab5080..977f51a62 100644 --- a/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts +++ b/addons/xterm-addon-web-links/src/WebLinksAddon.api.ts @@ -52,7 +52,7 @@ describe('WebLinksAddon', () => { }); async function testHostName(hostname: string): Promise { - await openTerminal({ rendererType: 'dom' }); + await openTerminal({ rendererType: 'dom', cols: 40 }); await page.evaluate(`window.term.loadAddon(new window.WebLinksAddon())`); await page.evaluate(` window.term.writeln(' http://${hostname} '); @@ -62,6 +62,7 @@ async function testHostName(hostname: string): Promise { window.term.writeln('"http://${hostname}/"'); window.term.writeln('\\'http://${hostname}/\\''); window.term.writeln('http://${hostname}/subpath/+/id'); + window.term.writeln('http://${hostname}/subpath/subpath2/subpath3/subpath4/subpath5/+/id'); `); assert.equal(await getLinkAtCell(3, 1), `http://${hostname}`); assert.equal(await getLinkAtCell(3, 2), `http://${hostname}/a~b#c~d?e~f`); @@ -70,6 +71,7 @@ async function testHostName(hostname: string): Promise { assert.equal(await getLinkAtCell(2, 5), `http://${hostname}/`); assert.equal(await getLinkAtCell(2, 6), `http://${hostname}/`); assert.equal(await getLinkAtCell(1, 7), `http://${hostname}/subpath/+/id`); + assert.equal(await getLinkAtCell(1, 8) + await getLinkAtCell(1, 9), `http://${hostname}/subpath/subpath2/subpath3/subpath4/subpath5/+/id`); } async function openTerminal(options: ITerminalOptions = {}): Promise {