]> git.r.bdr.sh - rbdr/forum/blame - src/lib/components/glyph/glyph.test.ts
Apply formatting
[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 = {
cac85db0 13 results: null
879fa389
RBR
14};
15
16describe('Glyph component', () => {
cac85db0
RBR
17 beforeEach(() => {
18 internals.results = render(Glyph, {
19 props: {
20 uuid: '9fb14ebc-bc64-400b-915f-d429ec44b8fe'
21 }
22 });
23 });
24
25 test('Should act as an image', () => {
26 expect(internals.results.getByRole('img')).toBeVisible();
27 });
28
29 test('Should render 4 glyphs', () => {
30 expect(internals.results.getByRole('img')).toHaveTextContent(/^. . . .$/);
31 });
879fa389 32});