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
|
// Wait for the tags list to render after the tab switch
|
||||||
await page.waitForSelector('ul > li');
|
await page.waitForSelector('ul > li');
|
||||||
|
|
||||||
// Hover over the "Familie" row to reveal the opacity-0 action buttons
|
// Hover over the "Fest" row to reveal the opacity-0 action buttons
|
||||||
const familieRow = page
|
const festRow = page
|
||||||
.locator('ul > li')
|
.locator('ul > li')
|
||||||
.filter({ has: page.locator('span', { hasText: /^Familie$/ }) });
|
.filter({ has: page.locator('span', { hasText: /^Fest$/ }) });
|
||||||
await familieRow.hover();
|
await festRow.hover();
|
||||||
await familieRow.getByRole('button', { name: 'Schlagwort bearbeiten' }).click();
|
await festRow.getByRole('button', { name: 'Schlagwort bearbeiten' }).click();
|
||||||
|
|
||||||
// After clicking edit, {#if editingTagId} replaces the span with a form —
|
// After clicking edit, {#if editingTagId} replaces the span with a form —
|
||||||
// the familieRow filter no longer matches, so we find the input directly.
|
// the festRow filter no longer matches, so we find the input directly.
|
||||||
await page.locator('input[name="name"]').fill('Familie (E2E)');
|
await page.locator('input[name="name"]').fill('Fest (E2E)');
|
||||||
await page.getByRole('button', { name: 'Speichern' }).click();
|
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' });
|
await page.screenshot({ path: 'test-results/e2e/admin-tag-renamed.png' });
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -205,14 +205,14 @@ test.describe('Admin — tag management', () => {
|
|||||||
|
|
||||||
const renamedRow = page
|
const renamedRow = page
|
||||||
.locator('ul > li')
|
.locator('ul > li')
|
||||||
.filter({ has: page.locator('span', { hasText: /^Familie \(E2E\)$/ }) });
|
.filter({ has: page.locator('span', { hasText: /^Fest \(E2E\)$/ }) });
|
||||||
await renamedRow.hover();
|
await renamedRow.hover();
|
||||||
await renamedRow.getByRole('button', { name: 'Schlagwort bearbeiten' }).click();
|
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 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' });
|
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 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' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -461,9 +461,11 @@ test.describe('PDF annotations — file hash versioning', () => {
|
|||||||
await page.waitForSelector('[data-hydrated]');
|
await page.waitForSelector('[data-hydrated]');
|
||||||
await page.locator('canvas').first().waitFor({ state: 'visible', timeout: 20000 });
|
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(
|
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 });
|
).toHaveCount(0, { timeout: 8000 });
|
||||||
await expect(page.locator('[data-testid="annotation-outdated-notice"]')).toBeVisible({
|
await expect(page.locator('[data-testid="annotation-outdated-notice"]')).toBeVisible({
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
|
|||||||
@@ -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>
|
|
||||||
|
|||||||
@@ -8,9 +8,12 @@ let {
|
|||||||
onfileParsed?: (result: FilenameParseResult) => void;
|
onfileParsed?: (result: FilenameParseResult) => void;
|
||||||
} = $props();
|
} = $props();
|
||||||
|
|
||||||
|
let selectedFilename = $state<string | null>(null);
|
||||||
|
|
||||||
function handleFileChange(e: Event) {
|
function handleFileChange(e: Event) {
|
||||||
const file = (e.target as HTMLInputElement).files?.[0];
|
const file = (e.target as HTMLInputElement).files?.[0];
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
|
selectedFilename = file.name;
|
||||||
const parsed = parseFilename(file.name);
|
const parsed = parseFilename(file.name);
|
||||||
const result: FilenameParseResult = {
|
const result: FilenameParseResult = {
|
||||||
...parsed,
|
...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"
|
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
<span class="text-sm font-medium text-ink-2">
|
{#if selectedFilename}
|
||||||
{m.doc_file_upload_label()}
|
<span class="text-ink-1 text-sm font-medium">{selectedFilename}</span>
|
||||||
</span>
|
{:else}
|
||||||
<span class="text-xs text-ink-3">{m.doc_file_upload_note()}</span>
|
<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>
|
</label>
|
||||||
<div class="px-6 pb-6">
|
<input id="file-upload" type="file" name="file" onchange={handleFileChange} class="sr-only" />
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user