diff --git a/plugins/interface/components/primitives.test.tsx b/plugins/interface/components/primitives.test.tsx new file mode 100644 index 0000000..12ec5fc --- /dev/null +++ b/plugins/interface/components/primitives.test.tsx @@ -0,0 +1,133 @@ +import { renderToString } from 'hono/jsx/dom/server' +import { describe, expect, it } from 'vitest' + +import { Avatar } from './avatar' +import { Card } from './card' +import { Input } from './input/Input' +import { Label } from './label/Label' +import { Loader } from './loader/Loader' +import { Toggle } from './toggle' + +describe('interface primitive components', () => { + it('renders avatar links with fallback initials and custom classes', () => { + const html = renderToString( + + ) + + expect(html).toContain('O

') + }) + + it('renders avatar images with accessible alt text and selected state', () => { + const html = renderToString( + + ) + + expect(html).toContain(' { + const link = renderToString( + + Docs + + ) + const panel = renderToString( + + Panel + + ) + + expect(link).toContain(' { + const invalid = renderToString( + + ) + const valid = renderToString( +