diff --git a/plugins/interface/components/avatar/index.test.tsx b/plugins/interface/components/avatar/index.test.tsx new file mode 100644 index 0000000..36ff5bb --- /dev/null +++ b/plugins/interface/components/avatar/index.test.tsx @@ -0,0 +1,42 @@ +import { renderToString } from 'hono/jsx/dom/server' +import { describe, expect, it } from 'vitest' +import { Avatar } from './index' + +describe('Avatar', () => { + it('renders a button avatar with the username initial', () => { + const html = renderToString( + + ) + + expect(html).toContain('S

') + }) + + it('renders an anchor avatar with an image when href and image are provided', () => { + const html = renderToString( + + ) + + expect(html).toContain(' { + it('renders a button with variant, size, title, and custom classes', () => { + const html = renderToString( + + ) + + expect(html).toContain('Icon') + }) + + it('uses anchor markup for href buttons and omits title text for square buttons', () => { + const html = renderToString( + + ) + + expect(html).toContain('Docs<') + expect(html).toContain('>D') + }) +}) diff --git a/plugins/interface/components/card/index.test.tsx b/plugins/interface/components/card/index.test.tsx new file mode 100644 index 0000000..18a7c42 --- /dev/null +++ b/plugins/interface/components/card/index.test.tsx @@ -0,0 +1,29 @@ +import { renderToString } from 'hono/jsx/dom/server' +import { describe, expect, it } from 'vitest' +import { Card } from './index' + +describe('Card', () => { + it('renders a secondary div card by default', () => { + const html = renderToString( + Card content + ) + + expect(html).toContain(' { + const html = renderToString( + + Tables + + ) + + expect(html).toContain(' { + it('renders a plain input with sizing, value, and invalid state classes', () => { + const html = renderToString( + + ) + + expect(html).toContain(' { + const html = renderToString( + + ) + + expect(html).toContain(' { + it('renders title and children', () => { + const html = renderToString( + + ) + + expect(html).toContain(' { + const html = renderToString( +