@fmidev/smartmet-alert-client 4.2.7 → 4.7.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -14
- package/.github/workflows/test.yaml +26 -0
- package/.nvmrc +1 -0
- package/dist/index.dark.html +1 -1
- package/dist/index.en.html +1 -1
- package/dist/index.fi.html +1 -1
- package/dist/index.html +5 -0
- package/dist/index.js +105 -135
- package/dist/index.mjs +112 -135
- package/dist/index.sv.html +1 -1
- package/dist/locale-en-DCEKDw5G.js +8 -0
- package/dist/locale-fi-DPiOM1rB.js +8 -0
- package/dist/locale-sv-B0FlbgEF.js +8 -0
- package/dist/vendor-Cfkkvdz7.js +21 -0
- package/dist/vue/index.mjs +15245 -0
- package/dist/vue/style.css +1 -0
- package/dist/xml-parser-BiNO9kc-.js +13 -0
- package/package.json +61 -25
- package/public/index.dark.html +1 -1
- package/public/index.en.html +1 -1
- package/public/index.fi.html +1 -1
- package/public/index.sv.html +1 -1
- package/src/AlertClientVue.vue +170 -0
- package/src/App.vue +58 -176
- package/src/assets/img/ui/arrow-down.svg +4 -14
- package/src/assets/img/ui/arrow-up.svg +4 -14
- package/src/assets/img/ui/clear.svg +7 -21
- package/src/assets/img/ui/close.svg +4 -15
- package/src/assets/img/ui/toggle-selected.svg +12 -0
- package/src/assets/img/ui/toggle-unselected.svg +12 -0
- package/src/assets/img/warning/cold-weather.svg +3 -6
- package/src/assets/img/warning/flood-level-3.svg +4 -7
- package/src/assets/img/warning/forest-fire-weather.svg +2 -6
- package/src/assets/img/warning/grass-fire-weather.svg +2 -6
- package/src/assets/img/warning/hot-weather.svg +3 -6
- package/src/assets/img/warning/pedestrian-safety.svg +3 -7
- package/src/assets/img/warning/rain.svg +2 -7
- package/src/assets/img/warning/sea-icing.svg +2 -6
- package/src/assets/img/warning/sea-thunder-storm.svg +2 -5
- package/src/assets/img/warning/sea-water-height-high-water.svg +3 -8
- package/src/assets/img/warning/sea-water-height-shallow-water.svg +3 -7
- package/src/assets/img/warning/sea-wave-height.svg +4 -7
- package/src/assets/img/warning/sea-wind-legend.svg +2 -5
- package/src/assets/img/warning/sea-wind.svg +2 -5
- package/src/assets/img/warning/several.svg +2 -5
- package/src/assets/img/warning/thunder-storm.svg +2 -5
- package/src/assets/img/warning/traffic-weather.svg +2 -6
- package/src/assets/img/warning/uv-note.svg +2 -6
- package/src/assets/img/warning/wind.svg +2 -5
- package/src/components/AlertClient.vue +42 -20
- package/src/components/CollapsiblePanel.vue +284 -0
- package/src/components/DayLarge.vue +40 -32
- package/src/components/DaySmall.vue +17 -7
- package/src/components/Days.vue +77 -52
- package/src/components/DescriptionWarning.vue +26 -8
- package/src/components/GrayScaleToggle.vue +42 -35
- package/src/components/Legend.vue +36 -240
- package/src/components/MapLarge.vue +55 -50
- package/src/components/MapSmall.vue +48 -29
- package/src/components/PopupRow.vue +6 -3
- package/src/components/Region.vue +162 -53
- package/src/components/RegionWarning.vue +33 -11
- package/src/components/Regions.vue +59 -29
- package/src/components/Warning.vue +53 -49
- package/src/components/Warnings.vue +54 -16
- package/src/locales/en.json +21 -4
- package/src/locales/fi.json +23 -6
- package/src/locales/sv.json +20 -3
- package/src/main.js +1 -0
- package/src/mixins/alertClientCore.js +210 -0
- package/src/mixins/config.js +263 -257
- package/src/mixins/utils.js +46 -15
- package/src/plugins/index.js +1 -1
- package/src/scss/_utilities.scss +193 -0
- package/src/scss/backgrounds.scss +2 -0
- package/src/scss/colors.scss +5 -3
- package/src/scss/constants.scss +3 -2
- package/src/scss/themes/dark-gray.scss +3 -3
- package/src/scss/themes/dark.scss +1 -1
- package/src/scss/themes/light-gray.scss +5 -5
- package/src/scss/themes/light.scss +3 -3
- package/src/scss/warningImages.scss +9 -5
- package/src/vue.js +41 -0
- package/svgo.config.js +45 -0
- package/tests/README.md +430 -0
- package/tests/fixtures/mockWarningData.js +135 -0
- package/tests/integration/warning-flow.spec.js +452 -0
- package/tests/setup.js +41 -0
- package/tests/unit/components/AlertClient.spec.js +734 -0
- package/tests/unit/components/DayLarge.spec.js +281 -0
- package/tests/unit/components/DaySmall.spec.js +278 -0
- package/tests/unit/components/Days.spec.js +565 -0
- package/tests/unit/components/DescriptionWarning.spec.js +432 -0
- package/tests/unit/components/GrayScaleToggle.spec.js +311 -0
- package/tests/unit/components/Legend.spec.js +223 -0
- package/tests/unit/components/MapLarge.spec.js +276 -0
- package/tests/unit/components/MapSmall.spec.js +226 -0
- package/tests/unit/components/PopupRow.spec.js +261 -0
- package/tests/unit/components/Region.spec.js +430 -0
- package/tests/unit/components/RegionWarning.snapshot.spec.js +73 -0
- package/tests/unit/components/RegionWarning.spec.js +408 -0
- package/tests/unit/components/Regions.spec.js +335 -0
- package/tests/unit/components/Warning.snapshot.spec.js +107 -0
- package/tests/unit/components/Warning.spec.js +472 -0
- package/tests/unit/components/Warnings.spec.js +329 -0
- package/tests/unit/components/__snapshots__/RegionWarning.snapshot.spec.js.snap +21 -0
- package/tests/unit/components/__snapshots__/Warning.snapshot.spec.js.snap +199 -0
- package/tests/unit/mixins/config.spec.js +269 -0
- package/tests/unit/mixins/i18n.spec.js +115 -0
- package/tests/unit/mixins/keycodes.spec.js +37 -0
- package/tests/unit/mixins/utils.spec.js +624 -0
- package/vite.config.js +96 -26
- package/vitest.config.js +40 -0
- package/dist/index.mjs.map +0 -1
- package/dist/index.relative.html +0 -19
- package/dist/index.start.html +0 -20
- package/playwright.config.ts +0 -18
- package/public/index.relative.html +0 -19
- package/public/index.start.html +0 -20
- package/src/assets/img/ui/toggle-selected-blue.svg +0 -4
- package/src/assets/img/ui/toggle-selected-dark.svg +0 -4
- package/src/assets/img/ui/toggle-selected-light.svg +0 -4
- package/src/assets/img/ui/toggle-unselected-dark.svg +0 -4
- package/src/assets/img/ui/toggle-unselected-light.svg +0 -4
- package/src/mixins/panzoom.js +0 -900
- package/test/snapshot.test.ts +0 -126
- package/vitest.config.ts +0 -6
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { describe, it, expect, afterEach } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import DescriptionWarning from '@/components/DescriptionWarning.vue'
|
|
4
|
+
|
|
5
|
+
const mockWarning = {
|
|
6
|
+
type: 'wind',
|
|
7
|
+
severity: 3,
|
|
8
|
+
direction: 270,
|
|
9
|
+
text: '15',
|
|
10
|
+
validInterval: '31.10. 14:00 – 1.11. 14:00',
|
|
11
|
+
info: {
|
|
12
|
+
fi: 'Kovaa tuulta',
|
|
13
|
+
sv: 'Hårt blåsväder',
|
|
14
|
+
en: 'Strong wind',
|
|
15
|
+
},
|
|
16
|
+
link: 'https://example.com/warning',
|
|
17
|
+
linkText: 'More info',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe('DescriptionWarning.vue', () => {
|
|
21
|
+
let wrapper
|
|
22
|
+
|
|
23
|
+
afterEach(() => {
|
|
24
|
+
if (wrapper) {
|
|
25
|
+
wrapper.unmount()
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
describe('Component mounting', () => {
|
|
30
|
+
it('should mount with required props', () => {
|
|
31
|
+
wrapper = mount(DescriptionWarning, {
|
|
32
|
+
props: {
|
|
33
|
+
input: mockWarning,
|
|
34
|
+
language: 'fi',
|
|
35
|
+
theme: 'light-theme',
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
expect(wrapper.exists()).toBe(true)
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
describe('Computed properties', () => {
|
|
44
|
+
it('should compute warningTitle from translation', () => {
|
|
45
|
+
wrapper = mount(DescriptionWarning, {
|
|
46
|
+
props: {
|
|
47
|
+
input: mockWarning,
|
|
48
|
+
language: 'fi',
|
|
49
|
+
theme: 'light-theme',
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
expect(typeof wrapper.vm.warningTitle).toBe('string')
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('should compute warningLevel from severity', () => {
|
|
57
|
+
wrapper = mount(DescriptionWarning, {
|
|
58
|
+
props: {
|
|
59
|
+
input: mockWarning,
|
|
60
|
+
language: 'fi',
|
|
61
|
+
theme: 'light-theme',
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
expect(typeof wrapper.vm.warningLevel).toBe('string')
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('should compute warningDetails with text and direction', () => {
|
|
69
|
+
wrapper = mount(DescriptionWarning, {
|
|
70
|
+
props: {
|
|
71
|
+
input: mockWarning,
|
|
72
|
+
language: 'fi',
|
|
73
|
+
theme: 'light-theme',
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
const details = wrapper.vm.warningDetails
|
|
78
|
+
expect(details).toContain('15')
|
|
79
|
+
expect(details).toContain('m/s')
|
|
80
|
+
expect(details).toContain('450') // 270 + 180
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it('should return empty warningDetails when text is null', () => {
|
|
84
|
+
const warningNoText = {
|
|
85
|
+
...mockWarning,
|
|
86
|
+
text: null,
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
wrapper = mount(DescriptionWarning, {
|
|
90
|
+
props: {
|
|
91
|
+
input: warningNoText,
|
|
92
|
+
language: 'fi',
|
|
93
|
+
theme: 'light-theme',
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
expect(wrapper.vm.warningDetails).toBe('')
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it('should return empty warningDetails when direction is null', () => {
|
|
101
|
+
const warningNoDirection = {
|
|
102
|
+
...mockWarning,
|
|
103
|
+
direction: null,
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
wrapper = mount(DescriptionWarning, {
|
|
107
|
+
props: {
|
|
108
|
+
input: warningNoDirection,
|
|
109
|
+
language: 'fi',
|
|
110
|
+
theme: 'light-theme',
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
expect(wrapper.vm.warningDetails).toBe('')
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it('should compute info from correct language', () => {
|
|
118
|
+
wrapper = mount(DescriptionWarning, {
|
|
119
|
+
props: {
|
|
120
|
+
input: mockWarning,
|
|
121
|
+
language: 'fi',
|
|
122
|
+
theme: 'light-theme',
|
|
123
|
+
},
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
expect(wrapper.vm.info).toBe('Kovaa tuulta')
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
it('should compute info in Swedish', () => {
|
|
130
|
+
wrapper = mount(DescriptionWarning, {
|
|
131
|
+
props: {
|
|
132
|
+
input: mockWarning,
|
|
133
|
+
language: 'sv',
|
|
134
|
+
theme: 'light-theme',
|
|
135
|
+
},
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
expect(wrapper.vm.info).toBe('Hårt blåsväder')
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
it('should compute validText', () => {
|
|
142
|
+
wrapper = mount(DescriptionWarning, {
|
|
143
|
+
props: {
|
|
144
|
+
input: mockWarning,
|
|
145
|
+
language: 'fi',
|
|
146
|
+
theme: 'light-theme',
|
|
147
|
+
},
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
expect(typeof wrapper.vm.validText).toBe('string')
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('should hide link when link is null', () => {
|
|
154
|
+
const warningNoLink = {
|
|
155
|
+
...mockWarning,
|
|
156
|
+
link: null,
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
wrapper = mount(DescriptionWarning, {
|
|
160
|
+
props: {
|
|
161
|
+
input: warningNoLink,
|
|
162
|
+
language: 'fi',
|
|
163
|
+
theme: 'light-theme',
|
|
164
|
+
},
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
expect(wrapper.vm.linkHidden).toBe(true)
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
it('should hide link when link is empty string', () => {
|
|
171
|
+
const warningEmptyLink = {
|
|
172
|
+
...mockWarning,
|
|
173
|
+
link: '',
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
wrapper = mount(DescriptionWarning, {
|
|
177
|
+
props: {
|
|
178
|
+
input: warningEmptyLink,
|
|
179
|
+
language: 'fi',
|
|
180
|
+
theme: 'light-theme',
|
|
181
|
+
},
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
expect(wrapper.vm.linkHidden).toBe(true)
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
it('should show link when link exists', () => {
|
|
188
|
+
wrapper = mount(DescriptionWarning, {
|
|
189
|
+
props: {
|
|
190
|
+
input: mockWarning,
|
|
191
|
+
language: 'fi',
|
|
192
|
+
theme: 'light-theme',
|
|
193
|
+
},
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
expect(wrapper.vm.linkHidden).toBe(false)
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
it('should compute description from type and severity', () => {
|
|
200
|
+
wrapper = mount(DescriptionWarning, {
|
|
201
|
+
props: {
|
|
202
|
+
input: mockWarning,
|
|
203
|
+
language: 'fi',
|
|
204
|
+
theme: 'light-theme',
|
|
205
|
+
},
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
expect(typeof wrapper.vm.description).toBe('string')
|
|
209
|
+
})
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
describe('Fields mixin integration', () => {
|
|
213
|
+
it('should compute typeClass correctly', () => {
|
|
214
|
+
wrapper = mount(DescriptionWarning, {
|
|
215
|
+
props: {
|
|
216
|
+
input: mockWarning,
|
|
217
|
+
language: 'fi',
|
|
218
|
+
theme: 'light-theme',
|
|
219
|
+
},
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
expect(wrapper.vm.typeClass).toBe('wind')
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
it('should compute rotation from direction', () => {
|
|
226
|
+
wrapper = mount(DescriptionWarning, {
|
|
227
|
+
props: {
|
|
228
|
+
input: mockWarning,
|
|
229
|
+
language: 'fi',
|
|
230
|
+
theme: 'light-theme',
|
|
231
|
+
},
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
expect(wrapper.vm.rotation).toBe(270)
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
it('should compute invertedRotation', () => {
|
|
238
|
+
wrapper = mount(DescriptionWarning, {
|
|
239
|
+
props: {
|
|
240
|
+
input: mockWarning,
|
|
241
|
+
language: 'fi',
|
|
242
|
+
theme: 'light-theme',
|
|
243
|
+
},
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
expect(wrapper.vm.invertedRotation).toBe(90)
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
it('should compute severity', () => {
|
|
250
|
+
wrapper = mount(DescriptionWarning, {
|
|
251
|
+
props: {
|
|
252
|
+
input: mockWarning,
|
|
253
|
+
language: 'fi',
|
|
254
|
+
theme: 'light-theme',
|
|
255
|
+
},
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
expect(wrapper.vm.severity).toBe(3)
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
describe('Content rendering', () => {
|
|
263
|
+
it('should render warning title and interval', () => {
|
|
264
|
+
wrapper = mount(DescriptionWarning, {
|
|
265
|
+
props: {
|
|
266
|
+
input: mockWarning,
|
|
267
|
+
language: 'fi',
|
|
268
|
+
theme: 'light-theme',
|
|
269
|
+
},
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
const text = wrapper.text()
|
|
273
|
+
expect(text).toContain('31.10. 14:00 – 1.11. 14:00')
|
|
274
|
+
})
|
|
275
|
+
|
|
276
|
+
it('should render info text', () => {
|
|
277
|
+
wrapper = mount(DescriptionWarning, {
|
|
278
|
+
props: {
|
|
279
|
+
input: mockWarning,
|
|
280
|
+
language: 'fi',
|
|
281
|
+
theme: 'light-theme',
|
|
282
|
+
},
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
expect(wrapper.text()).toContain('Kovaa tuulta')
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
it('should render external link when present', () => {
|
|
289
|
+
wrapper = mount(DescriptionWarning, {
|
|
290
|
+
props: {
|
|
291
|
+
input: mockWarning,
|
|
292
|
+
language: 'fi',
|
|
293
|
+
theme: 'light-theme',
|
|
294
|
+
},
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
const link = wrapper.find('a.ext-link')
|
|
298
|
+
expect(link.exists()).toBe(true)
|
|
299
|
+
expect(link.attributes('href')).toBe('https://example.com/warning')
|
|
300
|
+
expect(link.text()).toBe('More info')
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
it('should hide link when not present', () => {
|
|
304
|
+
const warningNoLink = {
|
|
305
|
+
...mockWarning,
|
|
306
|
+
link: null,
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
wrapper = mount(DescriptionWarning, {
|
|
310
|
+
props: {
|
|
311
|
+
input: warningNoLink,
|
|
312
|
+
language: 'fi',
|
|
313
|
+
theme: 'light-theme',
|
|
314
|
+
},
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
const link = wrapper.find('a.ext-link')
|
|
318
|
+
expect(link.classes()).toContain('d-none')
|
|
319
|
+
})
|
|
320
|
+
|
|
321
|
+
it('should render text in warning icon', () => {
|
|
322
|
+
wrapper = mount(DescriptionWarning, {
|
|
323
|
+
props: {
|
|
324
|
+
input: mockWarning,
|
|
325
|
+
language: 'fi',
|
|
326
|
+
theme: 'light-theme',
|
|
327
|
+
},
|
|
328
|
+
})
|
|
329
|
+
|
|
330
|
+
expect(wrapper.find('.symbol-text').text()).toBe('15')
|
|
331
|
+
})
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
describe('CSS classes', () => {
|
|
335
|
+
it('should apply severity level class', () => {
|
|
336
|
+
wrapper = mount(DescriptionWarning, {
|
|
337
|
+
props: {
|
|
338
|
+
input: mockWarning,
|
|
339
|
+
language: 'fi',
|
|
340
|
+
theme: 'light-theme',
|
|
341
|
+
},
|
|
342
|
+
})
|
|
343
|
+
|
|
344
|
+
const image = wrapper.find('.warning-image')
|
|
345
|
+
expect(image.classes()).toContain('level-3')
|
|
346
|
+
})
|
|
347
|
+
|
|
348
|
+
it('should apply type class', () => {
|
|
349
|
+
wrapper = mount(DescriptionWarning, {
|
|
350
|
+
props: {
|
|
351
|
+
input: mockWarning,
|
|
352
|
+
language: 'fi',
|
|
353
|
+
theme: 'light-theme',
|
|
354
|
+
},
|
|
355
|
+
})
|
|
356
|
+
|
|
357
|
+
const image = wrapper.find('.warning-image')
|
|
358
|
+
expect(image.classes()).toContain('wind')
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
it('should apply rotation class', () => {
|
|
362
|
+
wrapper = mount(DescriptionWarning, {
|
|
363
|
+
props: {
|
|
364
|
+
input: mockWarning,
|
|
365
|
+
language: 'fi',
|
|
366
|
+
theme: 'light-theme',
|
|
367
|
+
},
|
|
368
|
+
})
|
|
369
|
+
|
|
370
|
+
const image = wrapper.find('.warning-image')
|
|
371
|
+
expect(image.classes()).toContain('transform-rotate-270')
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
it('should apply theme class', () => {
|
|
375
|
+
wrapper = mount(DescriptionWarning, {
|
|
376
|
+
props: {
|
|
377
|
+
input: mockWarning,
|
|
378
|
+
language: 'fi',
|
|
379
|
+
theme: 'dark-theme',
|
|
380
|
+
},
|
|
381
|
+
})
|
|
382
|
+
|
|
383
|
+
expect(wrapper.find('.current-description-row').classes()).toContain(
|
|
384
|
+
'dark-theme'
|
|
385
|
+
)
|
|
386
|
+
})
|
|
387
|
+
})
|
|
388
|
+
|
|
389
|
+
describe('Accessibility', () => {
|
|
390
|
+
it('should have aria-label on warning image', () => {
|
|
391
|
+
wrapper = mount(DescriptionWarning, {
|
|
392
|
+
props: {
|
|
393
|
+
input: mockWarning,
|
|
394
|
+
language: 'fi',
|
|
395
|
+
theme: 'light-theme',
|
|
396
|
+
},
|
|
397
|
+
})
|
|
398
|
+
|
|
399
|
+
const image = wrapper.find('.warning-image')
|
|
400
|
+
expect(image.attributes('aria-label')).toBeDefined()
|
|
401
|
+
})
|
|
402
|
+
|
|
403
|
+
it('should mark symbol text as aria-hidden', () => {
|
|
404
|
+
wrapper = mount(DescriptionWarning, {
|
|
405
|
+
props: {
|
|
406
|
+
input: mockWarning,
|
|
407
|
+
language: 'fi',
|
|
408
|
+
theme: 'light-theme',
|
|
409
|
+
},
|
|
410
|
+
})
|
|
411
|
+
|
|
412
|
+
expect(
|
|
413
|
+
wrapper
|
|
414
|
+
.find('.current-description-image-cell')
|
|
415
|
+
.attributes('aria-hidden')
|
|
416
|
+
).toBe('true')
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
it('should open link in new tab', () => {
|
|
420
|
+
wrapper = mount(DescriptionWarning, {
|
|
421
|
+
props: {
|
|
422
|
+
input: mockWarning,
|
|
423
|
+
language: 'fi',
|
|
424
|
+
theme: 'light-theme',
|
|
425
|
+
},
|
|
426
|
+
})
|
|
427
|
+
|
|
428
|
+
const link = wrapper.find('a.ext-link')
|
|
429
|
+
expect(link.attributes('target')).toBe('_blank')
|
|
430
|
+
})
|
|
431
|
+
})
|
|
432
|
+
})
|