mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Add InputHandler.setCursorStyle test
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import { assert } from 'chai';
|
||||
import { InputHandler } from './InputHandler';
|
||||
|
||||
describe('InputHandler', () => {
|
||||
describe('setCursorStyle', () => {
|
||||
it('should call Terminal.setOption with correct params', () => {
|
||||
let options = {};
|
||||
let terminal = {
|
||||
setOption: (option, value) => options[option] = value
|
||||
};
|
||||
let inputHandler = new InputHandler(terminal);
|
||||
|
||||
inputHandler.setCursorStyle([0]);
|
||||
assert.equal(options['cursorStyle'], 'block');
|
||||
assert.equal(options['cursorBlink'], true);
|
||||
|
||||
options = {};
|
||||
inputHandler.setCursorStyle([1]);
|
||||
assert.equal(options['cursorStyle'], 'block');
|
||||
assert.equal(options['cursorBlink'], true);
|
||||
|
||||
options = {};
|
||||
inputHandler.setCursorStyle([2]);
|
||||
assert.equal(options['cursorStyle'], 'block');
|
||||
assert.equal(options['cursorBlink'], false);
|
||||
|
||||
options = {};
|
||||
inputHandler.setCursorStyle([3]);
|
||||
assert.equal(options['cursorStyle'], 'underline');
|
||||
assert.equal(options['cursorBlink'], true);
|
||||
|
||||
options = {};
|
||||
inputHandler.setCursorStyle([4]);
|
||||
assert.equal(options['cursorStyle'], 'underline');
|
||||
assert.equal(options['cursorBlink'], false);
|
||||
|
||||
options = {};
|
||||
inputHandler.setCursorStyle([5]);
|
||||
assert.equal(options['cursorStyle'], 'bar');
|
||||
assert.equal(options['cursorBlink'], true);
|
||||
|
||||
options = {};
|
||||
inputHandler.setCursorStyle([6]);
|
||||
assert.equal(options['cursorStyle'], 'bar');
|
||||
assert.equal(options['cursorBlink'], false);
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user