feat: render OneNote notebook hierarchy

This commit is contained in:
2026-07-22 19:05:49 +02:00
parent d282b832ac
commit 670310ea9e
14 changed files with 887 additions and 103 deletions

View File

@@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest';
import { resolveTocChildPath } from './toc-hierarchy.js';
describe('ONEPKG TOC child paths', () => {
it('joins a single NFC-normalized child name within its section group', () => {
expect(resolveTocChildPath('Projects', 'Cafe\u0301.one')).toBe(
'Projects/Café.one'
);
});
it.each(['../Secret.one', '..', 'nested/Secret.one', 'C:\\Secret.one'])(
'rejects unsafe FolderChildFilename %s',
(filename) => {
expect(() => resolveTocChildPath('Projects', filename)).toThrow(
/Unsafe FolderChildFilename/u
);
}
);
});