fix particle analysis table units and load image missing channels

This commit is contained in:
2026-03-27 20:37:06 -07:00
parent bc0c25085d
commit 160f714bad
10 changed files with 510 additions and 183 deletions

View File

@@ -0,0 +1,40 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {
beginTrackedNodeRequest,
isTrackedNodeRequestCurrent,
resolveLoadNodeChannelPath,
} from '../src/loadNodeOutputs.js';
test('resolveLoadNodeChannelPath can resolve a new ImageDemo node from its explicit selection before mount', () => {
const resolvedPath = resolveLoadNodeChannelPath({
explicitPath: 'APL_Figure4.ibw',
className: '',
widgetValues: {},
});
assert.equal(resolvedPath, 'APL_Figure4.ibw');
});
test('resolveLoadNodeChannelPath falls back to the current widget value for load nodes', () => {
assert.equal(resolveLoadNodeChannelPath({
className: 'Image',
widgetValues: { filename: 'scan.ibw' },
}), 'scan.ibw');
assert.equal(resolveLoadNodeChannelPath({
className: 'ImageDemo',
widgetValues: { name: 'demo.ibw' },
}), 'demo.ibw');
});
test('tracked load-node requests ignore stale async responses', () => {
const requestVersions = new Map();
const first = beginTrackedNodeRequest(requestVersions, '42');
const second = beginTrackedNodeRequest(requestVersions, '42');
assert.equal(isTrackedNodeRequestCurrent(requestVersions, '42', first), false);
assert.equal(isTrackedNodeRequestCurrent(requestVersions, '42', second), true);
});