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

@@ -169,6 +169,7 @@ describe('OneNoteApplication', () => {
sourceSize: 1,
entries: [],
sections: [],
tree: { interpreted: false, nodes: [] },
diagnostics: [],
};
render(
@@ -237,11 +238,36 @@ describe('OneNoteApplication', () => {
],
},
],
tree: {
interpreted: true,
tocPath: 'Open Notebook.onetoc2',
nodes: [
{
kind: 'section-group',
id: 'Notes',
displayName: 'Notes',
children: [
{
kind: 'section',
id: 'readable',
sectionId: 'readable',
displayName: 'Readable',
},
{
kind: 'section',
id: 'broken',
sectionId: 'broken',
displayName: 'Broken',
},
],
},
],
},
diagnostics: [
{
severity: 'warning',
code: 'TOC_NOT_INTERPRETED',
message: 'Package path order is temporary.',
code: 'TEST_PACKAGE_WARNING',
message: 'Example recoverable package warning.',
recoverable: true,
},
],
@@ -263,10 +289,12 @@ describe('OneNoteApplication', () => {
expect(
await screen.findByRole('heading', { name: 'Package summary' })
).toBeInTheDocument();
expect(screen.getByText('Notes')).toBeVisible();
expect(screen.getByText('OneNote notebook order')).toBeVisible();
expect(
screen.getByRole('button', { name: /Broken, failed/i })
).toBeVisible();
expect(screen.getByText('TOC_NOT_INTERPRETED')).toBeInTheDocument();
expect(screen.getByText('TEST_PACKAGE_WARNING')).toBeInTheDocument();
expect(
await within(
screen.getByRole('article', { name: 'First meeting' })