js array integration test for addCsiHandler

This commit is contained in:
Jörg Breitbart
2019-07-02 22:38:20 +02:00
parent 65b757bc19
commit 17ca958542
+17
View File
@@ -309,6 +309,23 @@ describe('InputHandler Integration Tests', function(): void {
});
});
});
describe('addCsiHandler', () => {
it('should call custom CSI handler with js array params', async () => {
await page.evaluate(`
window.term.reset();
const _customCsiHandlerParams = [];
const _customCsiHandler = window.term.addCsiHandler('m', (params, collect) => {
_customCsiHandlerParams.push(params);
return false;
}, '');
`);
await page.evaluate(`
window.term.write('\x1b[38;5;123mparams\x1b[38:2::50:100:150msubparams');
`);
assert.deepEqual(await page.evaluate(`(() => _customCsiHandlerParams)();`), [[38, 5, 123], [38, [2, -1, 50, 100, 150]]]);
});
});
});
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {