SRP split: HealthDashboardView (presentational, props-based) + HealthDashboard (smart wrapper, useFetch). Enables 4 Storybook stories per state + unit testability per branch. Existing testids preserved, Playwright tests still pass. Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
27 lines
809 B
TypeScript
27 lines
809 B
TypeScript
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
import HealthDashboard from './HealthDashboard.vue'
|
|
|
|
const meta: Meta<typeof HealthDashboard> = {
|
|
title: 'Components/HealthDashboard',
|
|
component: HealthDashboard,
|
|
tags: ['autodocs'],
|
|
parameters: {
|
|
docs: {
|
|
description: {
|
|
component:
|
|
'Smart wrapper that calls /api/healthz internally and delegates rendering to HealthDashboardView. ' +
|
|
'For state-by-state previews (Healthy, Loading, Error), see ' +
|
|
'[HealthDashboardView stories](?path=/docs/components-healthdashboardview--docs).',
|
|
},
|
|
},
|
|
},
|
|
}
|
|
export default meta
|
|
|
|
type Story = StoryObj<typeof meta>
|
|
|
|
// Default story - calls real /api/healthz (works in browser if dev proxy + backend are up)
|
|
export const Default: Story = {
|
|
args: {},
|
|
}
|