1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
/* eslint-disable max-statements */
import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '@testing-library/react';
import { Icon } from './icon';
/* eslint-disable jsx-a11y/prefer-tag-over-role -- Valid on SVG */
describe('Icon', () => {
it('can render an icon with a heading', () => {
const heading = 'architecto';
render(<Icon heading={heading} shape="arrow" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('can render an icon with a description', () => {
const description = 'fuga voluptates eligendi';
render(<Icon description={description} shape="arrow" role="img" />);
expect(rtlScreen.getByRole('img')).toHaveTextContent(description);
});
it('render an icon with bottom arrow shape', () => {
const heading = 'quae';
render(
<Icon heading={heading} orientation="bottom" shape="arrow" role="img" />
);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with left arrow shape', () => {
const heading = 'nemo';
render(
<Icon heading={heading} orientation="left" shape="arrow" role="img" />
);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with right arrow shape', () => {
const heading = 'odit';
render(
<Icon heading={heading} orientation="right" shape="arrow" role="img" />
);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with top arrow shape', () => {
const heading = 'ut';
render(
<Icon heading={heading} orientation="top" shape="arrow" role="img" />
);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with career shape', () => {
const heading = 'autem';
render(<Icon heading={heading} shape="career" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with cc-by-sa shape', () => {
const heading = 'blanditiis';
render(<Icon heading={heading} shape="cc-by-sa" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with cog shape', () => {
const heading = 'consequatur';
render(<Icon heading={heading} shape="cog" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with computer shape', () => {
const heading = 'amet';
render(<Icon heading={heading} shape="computer" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with cross shape', () => {
const heading = 'molestias';
render(<Icon heading={heading} shape="cross" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with envelop shape', () => {
const heading = 'laudantium';
render(<Icon heading={heading} shape="envelop" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with feed shape', () => {
const heading = 'beatae';
render(<Icon heading={heading} shape="feed" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with help shape', () => {
const heading = 'quidem';
render(<Icon heading={heading} shape="help" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with home shape', () => {
const heading = 'aut';
render(<Icon heading={heading} shape="home" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with magnifying glass shape', () => {
const heading = 'rerum';
render(<Icon heading={heading} shape="magnifying-glass" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with moon shape', () => {
const heading = 'saepe';
render(<Icon heading={heading} shape="moon" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with posts stack shape', () => {
const heading = 'sunt';
render(<Icon heading={heading} shape="posts-stack" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with sun shape', () => {
const heading = 'aut';
render(<Icon heading={heading} shape="sun" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with hamburger shape', () => {
const heading = 'sed';
render(<Icon aria-label={heading} shape="hamburger" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with minus shape', () => {
const heading = 'sunt';
render(<Icon aria-label={heading} shape="minus" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
it('render an icon with plus shape', () => {
const heading = 'maxime';
render(<Icon aria-label={heading} shape="plus" role="img" />);
expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument();
});
});
|