import { assert } from 'chai';
import { ITerminal } from './Interfaces';
import { SelectionModel } from './SelectionModel';
+import {BufferSet} from './BufferSet';
+import { MockTerminal } from './utils/TestUtils';
class TestSelectionModel extends SelectionModel {
constructor(
) {
super(terminal);
}
-
- public areSelectionValuesReversed(): boolean { return this._areSelectionValuesReversed(); }
}
describe('SelectionManager', () => {
let model: TestSelectionModel;
beforeEach(() => {
- terminal = <any>{ cols: 80, rows: 2, ybase: 0 };
+ terminal = new MockTerminal();
+ terminal.cols = 80;
+ terminal.rows = 2;
+ terminal.scrollback = 10;
+ terminal.buffers = new BufferSet(terminal);
+ terminal.buffer = terminal.buffers.active;
+
model = new TestSelectionModel(terminal);
});
});
});
- describe('_areSelectionValuesReversed', () => {
+ describe('areSelectionValuesReversed', () => {
it('should return true when the selection end is before selection start', () => {
model.selectionStart = [1, 0];
model.selectionEnd = [0, 0];