Skip to main content
Glama
deleonio
by deleonio
snapshot.test.tsx1.37 kB
import { h } from '@stencil/core'; import { renderFunctionalComponentToSpecPage } from '../../../utils/testing'; import KolFormFieldHintFc from '../FormFieldHint'; describe('KolFormFieldHintFc', () => { it('should render with hint', async () => { const hint = 'This is a hint'; const id = 'test-id'; const classNames = 'custom-class'; const page = await renderFunctionalComponentToSpecPage(() => <KolFormFieldHintFc hint={hint} id={id} class={classNames} />); expect(page.root).toMatchSnapshot(); expect(page.root?.textContent).toContain(hint); }); it('should not render without hint', async () => { const page = await renderFunctionalComponentToSpecPage(() => <KolFormFieldHintFc />); expect(page.root).toBeNull(); }); it('should set the correct id', async () => { const hint = 'This is a hint'; const id = 'test-id'; const page = await renderFunctionalComponentToSpecPage(() => <KolFormFieldHintFc hint={hint} id={id} />); expect(page.root?.id).toBe(`${id}-hint`); }); it('should set the correct class names', async () => { const hint = 'This is a hint'; const classNames = 'custom-class'; const page = await renderFunctionalComponentToSpecPage(() => <KolFormFieldHintFc hint={hint} class={classNames} />); expect(page.root?.className).toContain('hint'); expect(page.root?.className).toContain(classNames); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server