fix: preserve responsive image proportions

This commit is contained in:
2026-07-22 20:52:41 +02:00
parent df77f7810b
commit e3aaea02ee
12 changed files with 38 additions and 12 deletions

View File

@@ -59,6 +59,9 @@ const page: OneNotePageDto = {
id: 'image-1',
resourceId: 'resource-image',
altText: 'Embedded diagram',
pictureWidth: 8,
pictureHeight: 4,
href: 'https://example.com/diagram',
isBackground: false,
layout: {},
},
@@ -141,6 +144,13 @@ describe('PageReader structured content', () => {
screen.getByRole('img', { name: 'Embedded diagram' })
).toHaveAttribute('src', 'blob:local-image')
);
expect(screen.getByRole('img', { name: 'Embedded diagram' })).toHaveStyle({
width: '384px',
height: 'auto',
});
expect(
screen.getByRole('link', { name: 'Embedded diagram' })
).toHaveAttribute('href', 'https://example.com/diagram');
});
it('downloads an attachment only after an explicit user action', async () => {