No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
1 | 1 | import {createEvent, getConfig, fireEvent} from '@testing-library/dom' |
|
2 | 2 | import {click} from './click' |
|
3 | 3 | import {focus} from './focus' |
|
4 | + | import {hover, unhover} from './hover' |
|
4 | 5 | ||
5 | 6 | function selectOptionsBase(newValue, select, values, init) { |
|
6 | 7 | if (!newValue && !select.multiple) { |
18 | 19 | if (allOptions.includes(val)) { |
|
19 | 20 | return val |
|
20 | 21 | } else { |
|
21 | - | const matchingOption = allOptions.find(o => o.value === val) |
|
22 | + | const matchingOption = allOptions.find( |
|
23 | + | o => o.value === val || o.innerHTML === val, |
|
24 | + | ) |
|
22 | 25 | if (matchingOption) { |
|
23 | 26 | return matchingOption |
|
24 | 27 | } else { |
61 | 64 | } |
|
62 | 65 | ||
63 | 66 | function selectOption(option) { |
|
64 | - | option.selected = newValue |
|
65 | - | fireEvent( |
|
66 | - | select, |
|
67 | - | createEvent('input', select, { |
|
68 | - | bubbles: true, |
|
69 | - | cancelable: false, |
|
70 | - | composed: true, |
|
71 | - | ...init, |
|
72 | - | }), |
|
73 | - | ) |
|
74 | - | fireEvent.change(select, init) |
|
67 | + | if (option.getAttribute('role') === 'option') { |
|
68 | + | option?.setAttribute?.('aria-selected', newValue) |
|
69 | + | ||
70 | + | hover(option, init) |
|
71 | + | click(option, init) |
|
72 | + | unhover(option, init) |
|
73 | + | } else { |
|
74 | + | option.selected = newValue |
|
75 | + | fireEvent( |
|
76 | + | select, |
|
77 | + | createEvent('input', select, { |
|
78 | + | bubbles: true, |
|
79 | + | cancelable: false, |
|
80 | + | composed: true, |
|
81 | + | ...init, |
|
82 | + | }), |
|
83 | + | ) |
|
84 | + | fireEvent.change(select, init) |
|
85 | + | } |
|
75 | 86 | } |
|
76 | 87 | } |
|
77 | 88 |
Files | Coverage |
---|---|
src | 100.00% |
Project Totals (12 files) | 100.00% |
#473
508ef4b
#473
baef301
#473
fae3778
#473
6fd309a
f6e6d13
#473
57433aa
#470
1a6e0fa
2d19a65