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:
33
frontend/src/routes/documents/new/page.svelte.test.ts
Normal file
33
frontend/src/routes/documents/new/page.svelte.test.ts
Normal 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();
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user