D2: JobErrorLine component + home/jobs page integration

- Add src/lib/components/JobErrorLine.svelte: reusable error banner with
  icon, truncated message, accent retry and danger delete buttons; Svelte 5
  runes; WCAG AA (role=alert/status, aria-busy, aria-label, focus ring)
- Integrate into src/routes/+page.svelte: replace .recent-err-line div with
  JobErrorLine; add handleRetry function updating jobs array in-place
- Integrate into src/routes/jobs/+page.svelte: remove inline .job-err-inline
  and .row-retry-slot; add JobErrorLine inside .job-info for failed/cancelled;
  refactor retryJobById/deleteJobById with clean (jobId: string) signatures;
  done-job delete preserved in row-actions
- Add src/tests/job-error-line.test.ts: 8 component rendering tests via
  @testing-library/svelte + happy-dom covering message, buttons, callbacks,
  fallback text, and ARIA roles
- Install @testing-library/svelte@5 and happy-dom as devDeps for component
  test support; update vitest.config.ts with svelte plugin, happy-dom env
  match glob, and browser resolve condition for Svelte 5 client build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Giancarmine Salucci
2026-07-17 08:19:22 +00:00
co-authored by Claude Sonnet 4.6
parent 0810c223e1
commit dd438d2a0b
7 changed files with 585 additions and 69 deletions
+6
View File
@@ -1,12 +1,17 @@
import { defineConfig } from 'vitest/config';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import path from 'path';
export default defineConfig({
plugins: [svelte({ hot: false })],
test: {
environment: 'node',
globals: true,
fileParallelism: false,
include: ['src/tests/**/*.test.ts'],
environmentMatchGlobs: [
['**/job-error-line.test.ts', 'happy-dom']
],
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
@@ -14,6 +19,7 @@ export default defineConfig({
}
},
resolve: {
conditions: ['browser'],
alias: {
'$lib': path.resolve('./src/lib')
}