feat(fase-16): add Spinner component + unit tests
Fase 16.1 — reusable inline loading indicator. SVG circle with stroke-dasharray + Tailwind animate-spin (respects motion-reduce). Sizes: sm=16, md=24, lg=40. Inherits currentColor so it plays nicely with the Fase 9 theme tokens. Wrapper has role=status + aria-live=polite and an sr-only m.loading() label (no new Paraglide strings). vitest.config: resolve.conditions=['browser'] + inline svelte so the Svelte 5 mount() API resolves to index-client.js instead of the server entry. Without it the new Spinner.test throws lifecycle_function_unavailable. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -16,9 +16,20 @@ export default defineConfig({
|
||||
globals: true,
|
||||
include: ['src/**/*.test.ts'],
|
||||
exclude: ['tests/**', 'node_modules/**', '.svelte-kit/**'],
|
||||
setupFiles: ['./vitest.setup.ts']
|
||||
setupFiles: ['./vitest.setup.ts'],
|
||||
// Force Svelte to load its browser entry (index-client.js) instead of
|
||||
// the server entry — `mount()` only exists on the client. Without this
|
||||
// any test that mounts a Svelte 5 component throws
|
||||
// `lifecycle_function_unavailable`. jsdom + the `browser` condition is
|
||||
// the canonical Svelte 5 unit-test setup.
|
||||
server: {
|
||||
deps: {
|
||||
inline: [/^svelte/]
|
||||
}
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
conditions: ['browser'],
|
||||
alias: {
|
||||
$lib: new URL('./src/lib', import.meta.url).pathname
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user