]>
Commit | Line | Data |
---|---|---|
a7cf03c1 RBR |
1 | /** |
2 | * @jest-environment jsdom | |
3 | */ | |
4 | ||
879fa389 RBR |
5 | import '@testing-library/jest-dom/extend-expect'; |
6 | ||
7 | import { render } from '@testing-library/svelte'; | |
a7cf03c1 | 8 | import '$lib/i18n'; |
879fa389 RBR |
9 | |
10 | import Glyph from './glyph.svelte'; | |
11 | ||
12 | const internals = { | |
cac85db0 | 13 | results: null |
879fa389 RBR |
14 | }; |
15 | ||
16 | describe('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 | }); |