Compare commits
3 Commits
c5e28ac18e
...
feature/68
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53b482c5f2 | ||
|
|
fa9577052d | ||
|
|
a7eaa40852 |
@@ -180,19 +180,19 @@ test.describe('Admin — tag management', () => {
|
||||
// Wait for the tags list to render after the tab switch
|
||||
await page.waitForSelector('ul > li');
|
||||
|
||||
// Hover over the "Familie" row to reveal the opacity-0 action buttons
|
||||
const familieRow = page
|
||||
// Hover over the "Fest" row to reveal the opacity-0 action buttons
|
||||
const festRow = page
|
||||
.locator('ul > li')
|
||||
.filter({ has: page.locator('span', { hasText: /^Familie$/ }) });
|
||||
await familieRow.hover();
|
||||
await familieRow.getByRole('button', { name: 'Schlagwort bearbeiten' }).click();
|
||||
.filter({ has: page.locator('span', { hasText: /^Fest$/ }) });
|
||||
await festRow.hover();
|
||||
await festRow.getByRole('button', { name: 'Schlagwort bearbeiten' }).click();
|
||||
|
||||
// After clicking edit, {#if editingTagId} replaces the span with a form —
|
||||
// the familieRow filter no longer matches, so we find the input directly.
|
||||
await page.locator('input[name="name"]').fill('Familie (E2E)');
|
||||
// the festRow filter no longer matches, so we find the input directly.
|
||||
await page.locator('input[name="name"]').fill('Fest (E2E)');
|
||||
await page.getByRole('button', { name: 'Speichern' }).click();
|
||||
|
||||
await expect(page.getByText('Familie (E2E)')).toBeVisible();
|
||||
await expect(page.getByText('Fest (E2E)')).toBeVisible();
|
||||
await page.screenshot({ path: 'test-results/e2e/admin-tag-renamed.png' });
|
||||
});
|
||||
|
||||
@@ -205,14 +205,14 @@ test.describe('Admin — tag management', () => {
|
||||
|
||||
const renamedRow = page
|
||||
.locator('ul > li')
|
||||
.filter({ has: page.locator('span', { hasText: /^Familie \(E2E\)$/ }) });
|
||||
.filter({ has: page.locator('span', { hasText: /^Fest \(E2E\)$/ }) });
|
||||
await renamedRow.hover();
|
||||
await renamedRow.getByRole('button', { name: 'Schlagwort bearbeiten' }).click();
|
||||
|
||||
await page.locator('input[name="name"]').fill('Familie');
|
||||
await page.locator('input[name="name"]').fill('Fest');
|
||||
await page.getByRole('button', { name: 'Speichern' }).click();
|
||||
|
||||
await expect(page.getByText('Familie')).toBeVisible();
|
||||
await expect(page.getByText('Fest')).toBeVisible();
|
||||
await page.screenshot({ path: 'test-results/e2e/admin-tag-restored.png' });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -167,7 +167,7 @@ test.describe('Document editing', () => {
|
||||
await page.getByRole('button', { name: 'Speichern', exact: true }).click();
|
||||
|
||||
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' });
|
||||
});
|
||||
});
|
||||
@@ -461,9 +461,11 @@ test.describe('PDF annotations — file hash versioning', () => {
|
||||
await page.waitForSelector('[data-hydrated]');
|
||||
await page.locator('canvas').first().waitFor({ state: 'visible', timeout: 20000 });
|
||||
|
||||
// Use :not() to exclude the outdated-notice element whose testid also starts with "annotation-"
|
||||
// Use :not() to exclude the outdated-notice and side-panel elements whose testid also starts with "annotation-"
|
||||
await expect(
|
||||
page.locator('[data-testid^="annotation-"]:not([data-testid="annotation-outdated-notice"])')
|
||||
page.locator(
|
||||
'[data-testid^="annotation-"]:not([data-testid="annotation-outdated-notice"]):not([data-testid="annotation-side-panel"])'
|
||||
)
|
||||
).toHaveCount(0, { timeout: 8000 });
|
||||
await expect(page.locator('[data-testid="annotation-outdated-notice"]')).toBeVisible({
|
||||
timeout: 5000
|
||||
|
||||
@@ -68,5 +68,6 @@ let selectedReceivers = $state(doc.receivers ?? []);
|
||||
<SaveBar docId={doc.id} />
|
||||
</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>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
import { enhance } from '$app/forms';
|
||||
|
||||
let { docId }: { docId: string } = $props();
|
||||
|
||||
@@ -78,5 +77,3 @@ let confirmDelete = $state(false);
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="mark-for-review-form" method="POST" action="?/markForReview" use:enhance></form>
|
||||
|
||||
@@ -8,9 +8,12 @@ let {
|
||||
onfileParsed?: (result: FilenameParseResult) => void;
|
||||
} = $props();
|
||||
|
||||
let selectedFilename = $state<string | null>(null);
|
||||
|
||||
function handleFileChange(e: Event) {
|
||||
const file = (e.target as HTMLInputElement).files?.[0];
|
||||
if (!file) return;
|
||||
selectedFilename = file.name;
|
||||
const parsed = parseFilename(file.name);
|
||||
const result: FilenameParseResult = {
|
||||
...parsed,
|
||||
@@ -45,23 +48,12 @@ function handleFileChange(e: Event) {
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"
|
||||
/>
|
||||
</svg>
|
||||
<span class="text-sm font-medium text-ink-2">
|
||||
{m.doc_file_upload_label()}
|
||||
</span>
|
||||
<span class="text-xs text-ink-3">{m.doc_file_upload_note()}</span>
|
||||
{#if selectedFilename}
|
||||
<span class="text-ink-1 text-sm font-medium">{selectedFilename}</span>
|
||||
{:else}
|
||||
<span class="text-sm font-medium text-ink-2">{m.doc_file_upload_label()}</span>
|
||||
<span class="text-xs text-ink-3">{m.doc_file_upload_note()}</span>
|
||||
{/if}
|
||||
</label>
|
||||
<div class="px-6 pb-6">
|
||||
<input
|
||||
id="file-upload"
|
||||
type="file"
|
||||
name="file"
|
||||
onchange={handleFileChange}
|
||||
class="block w-full cursor-pointer rounded border border-dashed border-line p-2 text-sm
|
||||
text-ink-2 file:mr-4 file:rounded
|
||||
file:border-0 file:bg-muted
|
||||
file:px-4 file:py-2
|
||||
file:text-sm file:font-semibold
|
||||
file:text-ink hover:file:bg-muted"
|
||||
/>
|
||||
</div>
|
||||
<input id="file-upload" type="file" name="file" onchange={handleFileChange} class="sr-only" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user