feat(lesereisen): frontend — type badge, Journey reader, type selector on new #789
@@ -24,6 +24,7 @@ const authorName = $derived(formatAuthorName(geschichte.author));
|
||||
{#if isJourney}
|
||||
<span
|
||||
data-testid="journey-badge"
|
||||
style="font-size: 0.75rem"
|
||||
class="inline-block rounded-full bg-journey-tint px-2 py-0.5 text-xs font-bold tracking-wider text-journey uppercase"
|
||||
>
|
||||
{m.journey_badge_list()}
|
||||
|
||||
@@ -25,6 +25,7 @@ const hasNote = $derived(item.note != null && item.note.trim().length > 0);
|
||||
<a
|
||||
href="/documents/{doc.id}"
|
||||
aria-label={ariaLabel}
|
||||
style="display: flex; min-height: 44px; flex-direction: column"
|
||||
class="flex min-h-[44px] flex-col gap-1 rounded border border-line bg-surface px-4 py-3 font-serif text-base text-ink hover:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring"
|
||||
>
|
||||
<span class="font-bold">{doc.title}</span>
|
||||
|
||||
@@ -46,6 +46,7 @@ function personName(p: { firstName?: string; lastName?: string }): string {
|
||||
<li>
|
||||
<a
|
||||
href="/persons/{p.id}"
|
||||
style="display: inline-flex; min-height: 44px"
|
||||
class="inline-flex min-h-[44px] items-center rounded-full bg-muted px-3 py-2.5 font-sans text-sm text-ink hover:bg-accent-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring"
|
||||
>
|
||||
{personName(p)}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest';
|
||||
import { cleanup, render } from 'vitest-browser-svelte';
|
||||
import { page, userEvent } from 'vitest/browser';
|
||||
|
||||
@@ -28,6 +28,9 @@ import type { components } from '$lib/generated/api';
|
||||
const { default: GeschichtePage } = await import('./+page.svelte');
|
||||
|
||||
afterEach(cleanup);
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
type GeschichteView = components['schemas']['GeschichteView'];
|
||||
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
// Load global CSS so Tailwind utility classes (text-xs, min-h-[44px], etc.)
|
||||
// are compiled and applied in browser-mode tests. Without this import the
|
||||
// @tailwindcss/vite plugin never generates the utility stylesheet, leaving
|
||||
// computed styles at browser defaults (16 px font, content-only height).
|
||||
import './routes/layout.css';
|
||||
|
||||
// Disable SvelteKit hover-prefetch (both data + code) in browser-mode tests.
|
||||
// ADR-012 / #553.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user