preact-components/tests/links/privacy-link.test.ts

37 lines
746 B
TypeScript
Raw Normal View History

2022-03-16 00:06:35 +00:00
import test from 'ava';
import {html} from 'htm/preact';
import {render} from 'preact-render-to-string';
import {PrivacyLink} from '../../source/gram.js';
test('PrivacyLink', (t) => {
t.snapshot(render(html`<${PrivacyLink} />`), 'Empty');
t.snapshot(
render(html`<${PrivacyLink} href="https://example.org">Example<//>`),
'Text children',
);
t.snapshot(
render(
html`
<${PrivacyLink} href="https://example.org">
Example <span class="bold">with children</span>
<//>
`,
),
'HTML children',
);
t.snapshot(
render(
html`
<${PrivacyLink} class="bold italic" href="https://example.org">
Example
<//>
`,
),
'CSS class',
);
});