fix: render decoded ink coordinates

This commit is contained in:
2026-07-22 19:20:18 +02:00
parent 1750a6b5c3
commit 531612829d
2 changed files with 33 additions and 18 deletions

View File

@@ -70,6 +70,24 @@ const page: OneNotePageDto = {
size: 12,
layout: {},
},
{
kind: 'ink',
id: 'ink-1',
strokes: [
{
points: [
{ x: 10, y: 20 },
{ x: 15, y: 25 },
{ x: 30, y: 40 },
],
width: 2,
color: 0xff0000,
},
],
children: [],
boundingBox: { x: 10, y: 20, width: 20, height: 20 },
layout: {},
},
],
diagnostics: [],
};
@@ -105,6 +123,13 @@ describe('PageReader structured content', () => {
'https://example.com/'
);
expect(screen.getByRole('table')).toHaveTextContent('AB');
expect(
screen.getByRole('img', { name: '1 handwritten or drawn stroke' })
).toHaveAttribute('viewBox', '-60 -50 160 160');
expect(document.querySelector('.onenote-ink path')).toHaveAttribute(
'd',
'M 10 20 L 15 25 30 40'
);
await waitFor(() =>
expect(
screen.getByRole('img', { name: 'Embedded diagram' })