WP-00: project skeleton with three-level test harness
Cargo workspace (domain, application, infrastructure, api), axum health endpoint with SPA fallback, Vue 3 + Tailwind frontend, Vitest, Playwright, Makefile, Gitea Actions CI and README. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
14
frontend/src/components/StatusBadge.test.ts
Normal file
14
frontend/src/components/StatusBadge.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import StatusBadge from './StatusBadge.vue'
|
||||
|
||||
describe('StatusBadge', () => {
|
||||
it('renders the label and an ok style', () => {
|
||||
const w = mount(StatusBadge, { props: { status: 'ok', label: 'Backend' } })
|
||||
expect(w.text()).toContain('Backend')
|
||||
expect(w.classes().join(' ')).toContain('green')
|
||||
})
|
||||
it('renders an error style', () => {
|
||||
const w = mount(StatusBadge, { props: { status: 'error', label: 'Backend' } })
|
||||
expect(w.classes().join(' ')).toContain('red')
|
||||
})
|
||||
})
|
||||
17
frontend/src/components/StatusBadge.vue
Normal file
17
frontend/src/components/StatusBadge.vue
Normal file
@ -0,0 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{ status: 'ok' | 'error' | 'unknown'; label: string }>()
|
||||
const styles = {
|
||||
ok: 'bg-green-100 text-green-800',
|
||||
error: 'bg-red-100 text-red-800',
|
||||
unknown: 'bg-gray-100 text-gray-700',
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
class="inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium"
|
||||
:class="styles[status]"
|
||||
>
|
||||
{{ label }}
|
||||
</span>
|
||||
</template>
|
||||
Reference in New Issue
Block a user