]> git.r.bdr.sh - rbdr/forum/blob - src/lib/components/glyph/glyph.test.ts
Remove outdated docs
[rbdr/forum] / src / lib / components / glyph / glyph.test.ts
1 /**
2 * @jest-environment jsdom
3 */
4
5 import '@testing-library/jest-dom/extend-expect';
6
7 import { render } from '@testing-library/svelte';
8 import '$lib/i18n';
9
10 import Glyph from './glyph.svelte';
11
12 const internals = {
13 results: null
14 };
15
16 describe('Glyph component', () => {
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 });
32 });