test(characters): mock persistence in the forms spec so it cannot write to the real library

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
mARTin-B78 2026-09-19 15:29:34 +02:00
parent 5877aa2edc
commit a920f67008

View File

@ -124,6 +124,8 @@ test('current-version image pairs marked inconsistent show a review warning', as
});
test('character appearance forms stay in one record and switch the detail view', async ({ page }) => {
// Switching the form saves the record, so stand in for the API instead of writing to the real library.
await mockRecord(page, { id: 'c-forms', book: 'Smoke Book', name: 'Zerwas', tags: '', sheet: {} });
await page.route('**/api/book-profile*', route => route.fulfill({ json: { profile: {} } }));
await page.goto('/', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('#lib-chars-list', { state: 'attached', timeout: 15_000 });