import type { Meta, StoryObj } from '@storybook/react-vite'; import { expect, within } from 'storybook/test'; import { UuidBadge } from '../../src/ui/UuidBadge/UuidBadge'; const meta: Meta = { title: 'UI/UuidBadge', component: UuidBadge, parameters: { layout: 'centered' }, tags: ['autodocs'], }; export default meta; type Story = StoryObj; export const Default: Story = { args: { id: '61d2b1c2-7664-4dca-974f-436c2ee90b2e' }, play: async ({ canvasElement }) => { // Shows a shortened id and keeps the full one in the tooltip const badge = within(canvasElement).getByTitle('61d2b1c2-7664-4dca-974f-436c2ee90b2e'); await expect(badge).toHaveTextContent('61d2…0b2e'); }, };