-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest-layout.js
More file actions
31 lines (22 loc) · 1.11 KB
/
Copy pathtest-layout.js
File metadata and controls
31 lines (22 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const { TuiLayoutManager } = require('./src/cli/orchestrator/core/tuiLayout');
const assert = require('assert');
console.log('Testing TuiLayoutManager...');
const layout = new TuiLayoutManager();
const topics = ['Analyst', 'Technical', 'Legal'];
const dims = { columns: 120, rows: 40 };
layout.createSwarmLayout(topics, dims);
assert.strictEqual(layout.panes.length, 3, 'Should have 3 panes');
assert.strictEqual(layout.mode, 'swarm', 'Mode should be swarm');
const analystPane = layout.getPane('Analyst');
assert.ok(analystPane, 'Should find Analyst pane');
assert.strictEqual(analystPane.width, 40, 'Pane width should be 120/3 = 40');
assert.strictEqual(analystPane.x, 0, 'First pane x should be 0');
const legalPane = layout.getPane('Legal');
assert.strictEqual(legalPane.x, 80, 'Third pane x should be 80');
// Test writing
analystPane.write('Hello World');
assert.strictEqual(analystPane.buffer[0], 'Hello World', 'Buffer should contain text');
// Test resize
layout.resize(150, 50);
assert.strictEqual(layout.getPane('Analyst').width, 50, 'Resized width should be 150/3 = 50');
console.log('TuiLayoutManager tests passed!');