Skip to main content
Glama
deleonio
by deleonio
snapshot.test.tsx1.65 kB
import { h } from '@stencil/core'; import { renderFunctionalComponentToSpecPage } from '../../../utils/testing'; import KolIconFc from '../Icon'; describe('KolIconFc', () => { it('should render correctly', async () => { const page = await renderFunctionalComponentToSpecPage(() => <KolIconFc icons="test" label="test" />); expect(page.root).toMatchSnapshot(); }); it('should render with the correct class', async () => { const className = 'test-class'; const page = await renderFunctionalComponentToSpecPage(() => <KolIconFc icons="test" label="test" class={className} />); expect(page.root).toMatchSnapshot(); expect(page.root?.className).toContain(className); }); it('should render with the correct style', async () => { const style = { color: 'red' }; const page = await renderFunctionalComponentToSpecPage(() => <KolIconFc icons="test" label="test" style={style} />); expect(page.root).toMatchSnapshot(); expect(page.root?.style.color).toBe('red'); }); it('should handle onClick event', async () => { const onClick = jest.fn(); const page = await renderFunctionalComponentToSpecPage(() => <KolIconFc icons="test" label="test" onClick={onClick} />); page.root?.click(); expect(onClick).toHaveBeenCalled(); }); it('should render with the correct icons and label', async () => { const icons = 'test-icons'; const label = 'test-label'; const page = await renderFunctionalComponentToSpecPage(() => <KolIconFc icons={icons} label={label} />); expect(page.root).toMatchSnapshot(); expect(page.root?.getAttribute('_icons')).toBe(icons); expect(page.root?.getAttribute('_label')).toBe(label); }); });

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