]>
Commit | Line | Data |
---|---|---|
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 | ||
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 | }); |