mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
1c6e4bf905
- Memo side-panel chrome on stable equal; read live theme when shell is open - Theme/System live subscribe only when those panels need it; scripts runs subscribe only while Scripts is visible - Treat workspaceById focus-only identity as stable for side panels - Include knownHosts / add-known-host / transfer-count handlers in stable keys - setScriptRuns publishes scriptRunsStore so automation has a single source
36 lines
888 B
TypeScript
36 lines
888 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
|
|
import { setScriptRuns, getScriptRuns } from './scriptAutomationCoordinator.ts';
|
|
import {
|
|
getScriptRunsSnapshot,
|
|
subscribeScriptRuns,
|
|
} from './scriptRunsStore.ts';
|
|
|
|
test('setScriptRuns publishes to scriptRunsStore for Scripts panel subscribers', () => {
|
|
const events: number[] = [];
|
|
const unsubscribe = subscribeScriptRuns(() => {
|
|
events.push(getScriptRunsSnapshot().length);
|
|
});
|
|
|
|
setScriptRuns([
|
|
{
|
|
runId: 'r1',
|
|
sessionId: 's1',
|
|
status: 'running',
|
|
startedAt: 1,
|
|
logs: [],
|
|
},
|
|
]);
|
|
|
|
assert.equal(getScriptRuns().length, 1);
|
|
assert.equal(getScriptRunsSnapshot().length, 1);
|
|
assert.equal(getScriptRunsSnapshot()[0]?.runId, 'r1');
|
|
assert.ok(events.includes(1));
|
|
|
|
setScriptRuns([]);
|
|
assert.equal(getScriptRunsSnapshot().length, 0);
|
|
|
|
unsubscribe();
|
|
});
|