4 import { assert } from 'chai';
5 import { ITerminal } from './Interfaces';
6 import { BufferSet } from './BufferSet';
7 import { Buffer } from './Buffer';
8 import { MockTerminal } from './utils/TestUtils';
10 describe('BufferSet', () => {
11 let terminal: ITerminal;
12 let bufferSet: BufferSet;
15 terminal = new MockTerminal();
18 terminal.scrollback = 1000;
19 bufferSet = new BufferSet(terminal);
22 describe('constructor', () => {
23 it('should create two different buffers: alt and normal', () => {
24 assert.instanceOf(bufferSet.normal, Buffer);
25 assert.instanceOf(bufferSet.alt, Buffer);
26 assert.notEqual(bufferSet.normal, bufferSet.alt);
30 describe('activateNormalBuffer', () => {
32 bufferSet.activateNormalBuffer();
35 it('should set the normal buffer as the currently active buffer', () => {
36 assert.equal(bufferSet.active, bufferSet.normal);
40 describe('activateAltBuffer', () => {
42 bufferSet.activateAltBuffer();
45 it('should set the alt buffer as the currently active buffer', () => {
46 assert.equal(bufferSet.active, bufferSet.alt);