feat: render OneNote notebook hierarchy
This commit is contained in:
20
src/onenote/onepkg/toc-hierarchy.test.ts
Normal file
20
src/onenote/onepkg/toc-hierarchy.test.ts
Normal 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
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user