diff --git a/test/checkbox-tree.test.mjs b/test/checkbox-tree.test.mjs index 7ad0a04..27f8ba8 100644 --- a/test/checkbox-tree.test.mjs +++ b/test/checkbox-tree.test.mjs @@ -8,7 +8,7 @@ globalThis.document = dom.window.document; globalThis.Element = dom.window.Element; globalThis.localStorage = dom.window.localStorage; -const { CheckboxTree } = await import('../web/lib/checkbox-tree/checkbox-tree.js'); +const { CheckboxTree } = await import('../web/vendor/checkbox-tree/checkbox-tree.js'); function createTree(options = {}) { const container = document.createElement('div'); @@ -57,6 +57,11 @@ test('partial child selection makes the parent indeterminate', () => { assert.deepEqual(tree.getSelectedIds(), ['first']); }); +test('can initially select every selectable node', () => { + const { tree } = createTree({ initiallySelected: true }); + assert.deepEqual(tree.getSelectedIds(), ['parent', 'first', 'second']); +}); + test('persists selection and collapsed branches per configured key', () => { localStorage.clear(); const first = createTree({ storageKey: 'example-tree' }); diff --git a/web/index.html b/web/index.html index f6a5e36..d8da1bc 100644 --- a/web/index.html +++ b/web/index.html @@ -8,7 +8,7 @@ - +
diff --git a/web/js/tree.js b/web/js/tree.js index 141363a..b5a19c7 100644 --- a/web/js/tree.js +++ b/web/js/tree.js @@ -1,4 +1,4 @@ -import { CheckboxTree } from '../lib/checkbox-tree/checkbox-tree.js'; +import { CheckboxTree } from '../vendor/checkbox-tree/checkbox-tree.js'; import { getSortedKeys } from './sort.js'; const STORAGE_KEY = 'tree-state-v2'; diff --git a/web/lib/checkbox-tree/README.md b/web/lib/checkbox-tree/README.md deleted file mode 100644 index 441aaf1..0000000 --- a/web/lib/checkbox-tree/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# CheckboxTree - -A dependency-free, instance-based checkbox tree for browser ES modules. - -## Usage - -```html - - -