fix(e2e): fix 4 failing e2e tests — strict mode locator and nested form
Some checks failed
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / E2E Tests (pull_request) Has been cancelled
CI / Unit & Component Tests (push) Successful in 2m23s
CI / Backend Unit Tests (push) Successful in 2m11s
CI / E2E Tests (push) Failing after 29m1s
Some checks failed
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / E2E Tests (pull_request) Has been cancelled
CI / Unit & Component Tests (push) Successful in 2m23s
CI / Backend Unit Tests (push) Successful in 2m11s
CI / E2E Tests (push) Failing after 29m1s
documents.spec.ts: replace getByText with getByRole('heading') to avoid
Svelte's #svelte-announcer matching the same text (strict mode violation).
SaveBar.svelte: move <form id="mark-for-review-form"> out of the component
and into +page.svelte as a sibling of delete-form. The form was previously
nested inside <form id="update-form">, which is invalid HTML. The browser
auto-repaired it, causing a Svelte hydration mismatch that broke the edit
form's use:enhance, preventing version snapshots from being recorded —
leaving history tests with 0 versions instead of the expected 2.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit was merged in pull request #89.
This commit is contained in:
@@ -167,7 +167,7 @@ test.describe('Document editing', () => {
|
|||||||
await page.getByRole('button', { name: 'Speichern', exact: true }).click();
|
await page.getByRole('button', { name: 'Speichern', exact: true }).click();
|
||||||
|
|
||||||
await expect(page).toHaveURL(/\/documents\/[^/]+$/);
|
await expect(page).toHaveURL(/\/documents\/[^/]+$/);
|
||||||
await expect(page.getByText('E2E Testbrief (überarbeitet)')).toBeVisible();
|
await expect(page.getByRole('heading', { name: 'E2E Testbrief (überarbeitet)' })).toBeVisible();
|
||||||
await page.screenshot({ path: 'test-results/e2e/document-edit-save.png' });
|
await page.screenshot({ path: 'test-results/e2e/document-edit-save.png' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -68,5 +68,6 @@ let selectedReceivers = $state(doc.receivers ?? []);
|
|||||||
<SaveBar docId={doc.id} />
|
<SaveBar docId={doc.id} />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<form id="mark-for-review-form" method="POST" action="?/markForReview" use:enhance></form>
|
||||||
<form id="delete-form" method="POST" action="?/delete" use:enhance></form>
|
<form id="delete-form" method="POST" action="?/delete" use:enhance></form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { m } from '$lib/paraglide/messages.js';
|
import { m } from '$lib/paraglide/messages.js';
|
||||||
import { enhance } from '$app/forms';
|
|
||||||
|
|
||||||
let { docId }: { docId: string } = $props();
|
let { docId }: { docId: string } = $props();
|
||||||
|
|
||||||
@@ -78,5 +77,3 @@ let confirmDelete = $state(false);
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="mark-for-review-form" method="POST" action="?/markForReview" use:enhance></form>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user