test(documents): smoke-cover the new document page

Renders BulkDocumentEditLayout with prop pass-through and an
empty-values branch.

Refs #496.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-10 01:15:14 +02:00
committed by marcel
parent 931c4f7134
commit f684ba3a61

View File

@@ -0,0 +1,33 @@
import { describe, it, expect, afterEach } from 'vitest';
import { cleanup, render } from 'vitest-browser-svelte';
import DocumentNewPage from './+page.svelte';
afterEach(cleanup);
describe('documents/new page', () => {
it('renders the BulkDocumentEditLayout with prop pass-through', async () => {
render(DocumentNewPage, {
props: {
data: {
initialSenderId: 'p1',
initialSenderName: 'Anna Schmidt',
initialReceivers: []
}
}
});
const main = document.body.firstElementChild;
expect(main).not.toBeNull();
});
it('renders without crashing when initial values are empty', async () => {
render(DocumentNewPage, {
props: {
data: { initialSenderId: '', initialSenderName: '', initialReceivers: [] }
}
});
const main = document.body.firstElementChild;
expect(main).not.toBeNull();
});
});