Skip to content

Commit 5be02ae

Browse files
committed
test(term): cover no-op InputEvent steps in update()
The renderer spec now accepts any InputEvent as an Update and requires non-resize, non-capability events to change no state and emit no bytes.
1 parent 1b45d66 commit 5be02ae

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎test/term.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,18 @@ hi
696696
expect(term.render(frame).output.length).toBe(0);
697697
});
698698

699+
it("ignores input events that are neither resize nor capability", () => {
700+
term.render(frame);
701+
let before = term.capabilities;
702+
let out = term.update([
703+
{ type: "keydown", key: "a", code: "a", text: "a" },
704+
{ type: "mousemove", button: "left", x: 1, y: 1 },
705+
]);
706+
expect(out).toEqual(new Uint8Array(0));
707+
expect(term.capabilities).toEqual(before);
708+
expect(term.render(frame).output.length).toBe(0);
709+
});
710+
699711
it("discards pointer interaction state on resize", () => {
700712
let pointer = { x: 1, y: 0, down: false };
701713
let first = term.render(frame, { pointer });

0 commit comments

Comments
 (0)