]> git.r.bdr.sh - rbdr/forum/blame - src/lib/components/glyph/glyph.test.ts
Update / use typescript
[rbdr/forum] / src / lib / components / glyph / glyph.test.ts
CommitLineData
a7cf03c1
RBR
1/**
2 * @jest-environment jsdom
3 */
4
879fa389
RBR
5import '@testing-library/jest-dom/extend-expect';
6
7import { render } from '@testing-library/svelte';
a7cf03c1 8import '$lib/i18n';
879fa389
RBR
9
10import Glyph from './glyph.svelte';
11
12const internals = {
13 results: null
14};
15
16describe('Glyph component', () => {
17
18 beforeEach(() => {
19
20 internals.results = render(Glyph, { props: {
21 uuid: '9fb14ebc-bc64-400b-915f-d429ec44b8fe'
22 } });
23 });
24
25 test('Should act as an image', () => {
26
27 expect(internals.results.getByRole('img'))
28 .toBeVisible();
29 });
30
31 test('Should render 4 glyphs', () => {
32
33 expect(internals.results.getByRole('img'))
34 .toHaveTextContent(/^. . . .$/);
35 });
36});