Support controlled multi-selection and visible ranges in Tree
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import {test} from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {treeSelectionRange} from '../packages/ui-react/dist/treeSelectionRange.js';
|
||||
test('tree ranges include endpoints in both directions and only visible rows',()=>{
|
||||
const visible=['project','group','first','last','other'];
|
||||
assert.deepEqual(treeSelectionRange(visible,'first','last'),['first','last']);
|
||||
assert.deepEqual(treeSelectionRange(visible,'last','first'),['first','last']);
|
||||
assert.deepEqual(treeSelectionRange(visible,'filtered-out','last'),['last']);
|
||||
assert.deepEqual(treeSelectionRange(visible,null,'first'),['first']);
|
||||
});
|
||||
Reference in New Issue
Block a user