@loadsmart/loadsmart-ui 5.13.0 → 5.13.2
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/dist/components/Select/useSelect.helpers.d.ts +2 -1
- package/dist/components/Select/useSelect.test.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Select/useSelect.helpers.test.ts +63 -1
- package/src/components/Select/useSelect.helpers.ts +9 -2
- package/src/components/Select/useSelect.test.ts +207 -0
- package/src/components/Select/useSelect.ts +8 -2
- package/src/testing/SelectEvent/SelectEvent.ts +28 -42
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDisplayValue, getValue } from './useSelect.helpers'
|
|
1
|
+
import { getDisplayValue, getValue, toSelection } from './useSelect.helpers'
|
|
2
2
|
import generator from '../../tests/generator'
|
|
3
3
|
|
|
4
4
|
import type { SelectAdapter, SelectValue, Option } from './Select.types'
|
|
@@ -60,6 +60,15 @@ describe('useSelect helpers', () => {
|
|
|
60
60
|
|
|
61
61
|
expect(getDisplayValue(adapters, selection, multiple)).toEqual(adapter.getLabel(item))
|
|
62
62
|
})
|
|
63
|
+
|
|
64
|
+
it('returns empty string as display value when selection label is undefined', () => {
|
|
65
|
+
const selection: SelectValue = new Map().set(undefined, {
|
|
66
|
+
label: undefined,
|
|
67
|
+
value: undefined,
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
expect(getDisplayValue(adapters, selection, multiple)).toEqual('')
|
|
71
|
+
})
|
|
63
72
|
})
|
|
64
73
|
|
|
65
74
|
describe('multiple selection', () => {
|
|
@@ -118,5 +127,58 @@ describe('useSelect helpers', () => {
|
|
|
118
127
|
|
|
119
128
|
expect(getDisplayValue(adapters, selection, multiple)).toEqual('')
|
|
120
129
|
})
|
|
130
|
+
|
|
131
|
+
it('returns empty string as display value when selection label is undefined', () => {
|
|
132
|
+
const selection: SelectValue = new Map().set(undefined, {
|
|
133
|
+
label: undefined,
|
|
134
|
+
value: undefined,
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
expect(getDisplayValue(adapters, selection, multiple)).toEqual('')
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
describe('getSelection', () => {
|
|
142
|
+
it('initializes correctly when a null value is provided', () => {
|
|
143
|
+
expect(toSelection(null)).toEqual([])
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
it('initializes correctly when an undefined value is provided', () => {
|
|
147
|
+
expect(toSelection(undefined)).toEqual([])
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
it('initializes correctly when a valid value is provided', () => {
|
|
151
|
+
expect(
|
|
152
|
+
toSelection({
|
|
153
|
+
value: 'some-value',
|
|
154
|
+
label: 'Some label',
|
|
155
|
+
} as Option)
|
|
156
|
+
).toEqual([
|
|
157
|
+
{
|
|
158
|
+
value: 'some-value',
|
|
159
|
+
label: 'Some label',
|
|
160
|
+
},
|
|
161
|
+
])
|
|
162
|
+
|
|
163
|
+
expect(
|
|
164
|
+
toSelection([
|
|
165
|
+
{
|
|
166
|
+
value: 'some-value-1',
|
|
167
|
+
label: 'Some label 1',
|
|
168
|
+
} as Option,
|
|
169
|
+
])
|
|
170
|
+
).toEqual([
|
|
171
|
+
{
|
|
172
|
+
value: 'some-value-1',
|
|
173
|
+
label: 'Some label 1',
|
|
174
|
+
},
|
|
175
|
+
])
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
it('initializes correctly when an empty value is provided', () => {
|
|
179
|
+
expect(toSelection([])).toEqual([])
|
|
180
|
+
expect(toSelection({})).toEqual([])
|
|
181
|
+
expect(toSelection([{}])).toEqual([])
|
|
182
|
+
})
|
|
121
183
|
})
|
|
122
184
|
})
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { GenericAdapter } from './Select.constants'
|
|
3
3
|
import isEmpty from 'utils/toolset/isEmpty'
|
|
4
|
+
import toArray from 'utils/toolset/toArray'
|
|
4
5
|
|
|
5
|
-
import type { SelectAdapter, SelectValue, Option, Adapters } from './Select.types'
|
|
6
|
+
import type { SelectAdapter, SelectValue, Option, Adapters, SelectProps } from './Select.types'
|
|
6
7
|
|
|
7
8
|
export function getAdapter(adapters: Adapters, type?: string): SelectAdapter<any> {
|
|
8
9
|
if (type == null) {
|
|
@@ -32,6 +33,12 @@ export function getValue(selection: SelectValue, multiple?: boolean): Option | O
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
export function toSelection(value: SelectProps['value']): Option[] {
|
|
37
|
+
const safeValue = toArray(value || [])
|
|
38
|
+
|
|
39
|
+
return safeValue.filter((option) => !isEmpty(option))
|
|
40
|
+
}
|
|
41
|
+
|
|
35
42
|
export function getDisplayValue(
|
|
36
43
|
adapters: Adapters,
|
|
37
44
|
selection: SelectValue,
|
|
@@ -46,7 +53,7 @@ export function getDisplayValue(
|
|
|
46
53
|
} else {
|
|
47
54
|
const value = getValue(selection, multiple)
|
|
48
55
|
const adapter = getAdapter(adapters, (value as Option)._type)
|
|
49
|
-
return adapter.getLabel(value)
|
|
56
|
+
return adapter.getLabel(value) ?? ''
|
|
50
57
|
}
|
|
51
58
|
}
|
|
52
59
|
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { renderHook } from '@testing-library/react-hooks'
|
|
2
|
+
|
|
3
|
+
import useSelect from './useSelect'
|
|
4
|
+
import type { SelectProps, Option } from './Select.types'
|
|
5
|
+
|
|
6
|
+
describe('useSelect', () => {
|
|
7
|
+
describe('single selection', () => {
|
|
8
|
+
it('initializes correctly when no value is provided', () => {
|
|
9
|
+
const props: SelectProps = {
|
|
10
|
+
multiple: false,
|
|
11
|
+
name: 'anything',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { result } = renderHook(() => useSelect(props))
|
|
15
|
+
const expectedSelected = new Map()
|
|
16
|
+
|
|
17
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
18
|
+
expect(result.current.query).toBe('')
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('initializes correctly when a null value is provided', () => {
|
|
22
|
+
const props: SelectProps = {
|
|
23
|
+
multiple: false,
|
|
24
|
+
name: 'anything',
|
|
25
|
+
value: null,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const { result } = renderHook(() => useSelect(props))
|
|
29
|
+
const expectedSelected = new Map()
|
|
30
|
+
|
|
31
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
32
|
+
expect(result.current.query).toBe('')
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('initializes correctly when an undefined value is provided', () => {
|
|
36
|
+
const props: SelectProps = {
|
|
37
|
+
multiple: false,
|
|
38
|
+
name: 'anything',
|
|
39
|
+
value: undefined,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const { result } = renderHook(() => useSelect(props))
|
|
43
|
+
const expectedSelected = new Map()
|
|
44
|
+
|
|
45
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
46
|
+
expect(result.current.query).toBe('')
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('initializes correctly when a valid value is provided', () => {
|
|
50
|
+
const props: SelectProps = {
|
|
51
|
+
multiple: false,
|
|
52
|
+
name: 'anything',
|
|
53
|
+
value: {
|
|
54
|
+
value: 'some-value',
|
|
55
|
+
label: 'Some label',
|
|
56
|
+
} as Option,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const { result } = renderHook(() => useSelect(props))
|
|
60
|
+
const expectedSelected = new Map().set('some-value', {
|
|
61
|
+
value: 'some-value',
|
|
62
|
+
label: 'Some label',
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
66
|
+
expect(result.current.query).toBe('Some label')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it('initializes correctly when an invalid value is provided', () => {
|
|
70
|
+
const props: SelectProps = {
|
|
71
|
+
multiple: false,
|
|
72
|
+
name: 'anything',
|
|
73
|
+
value: {
|
|
74
|
+
label: undefined,
|
|
75
|
+
value: undefined,
|
|
76
|
+
} as Option,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const { result } = renderHook(() => useSelect(props))
|
|
80
|
+
const expectedSelected = new Map().set(undefined, {
|
|
81
|
+
label: undefined,
|
|
82
|
+
value: undefined,
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
86
|
+
expect(result.current.query).toBe('')
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('initializes correctly when an empty value is provided', () => {
|
|
90
|
+
const props: SelectProps = {
|
|
91
|
+
multiple: false,
|
|
92
|
+
name: 'anything',
|
|
93
|
+
value: {},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const { result } = renderHook(() => useSelect(props))
|
|
97
|
+
const expectedSelected = new Map()
|
|
98
|
+
|
|
99
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
100
|
+
expect(result.current.query).toBe('')
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
describe('multiple selection', () => {
|
|
105
|
+
it('initializes correctly when no value is provided', () => {
|
|
106
|
+
const props: SelectProps = {
|
|
107
|
+
multiple: true,
|
|
108
|
+
name: 'anything',
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const { result } = renderHook(() => useSelect(props))
|
|
112
|
+
const expectedSelected = new Map()
|
|
113
|
+
|
|
114
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
115
|
+
expect(result.current.query).toBe('')
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
it('initializes correctly when a null value is provided', () => {
|
|
119
|
+
const props: SelectProps = {
|
|
120
|
+
multiple: true,
|
|
121
|
+
name: 'anything',
|
|
122
|
+
value: null,
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const { result } = renderHook(() => useSelect(props))
|
|
126
|
+
const expectedSelected = new Map()
|
|
127
|
+
|
|
128
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
129
|
+
expect(result.current.query).toBe('')
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it('initializes correctly when an undefined value is provided', () => {
|
|
133
|
+
const props: SelectProps = {
|
|
134
|
+
multiple: true,
|
|
135
|
+
name: 'anything',
|
|
136
|
+
value: undefined,
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const { result } = renderHook(() => useSelect(props))
|
|
140
|
+
|
|
141
|
+
const expectedSelected = new Map()
|
|
142
|
+
|
|
143
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
144
|
+
expect(result.current.query).toBe('')
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it('initializes correctly when a valid value is provided', () => {
|
|
148
|
+
const props: SelectProps = {
|
|
149
|
+
multiple: true,
|
|
150
|
+
name: 'anything',
|
|
151
|
+
value: [
|
|
152
|
+
{
|
|
153
|
+
value: 'some-value',
|
|
154
|
+
label: 'Some label',
|
|
155
|
+
} as Option,
|
|
156
|
+
],
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const { result } = renderHook(() => useSelect(props))
|
|
160
|
+
|
|
161
|
+
const expectedSelected = new Map().set('some-value', {
|
|
162
|
+
value: 'some-value',
|
|
163
|
+
label: 'Some label',
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
167
|
+
expect(result.current.query).toBe('')
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
it('initializes correctly when an invalid value is provided', () => {
|
|
171
|
+
const props: SelectProps = {
|
|
172
|
+
multiple: true,
|
|
173
|
+
name: 'anything',
|
|
174
|
+
value: [
|
|
175
|
+
{
|
|
176
|
+
label: undefined,
|
|
177
|
+
value: undefined,
|
|
178
|
+
} as Option,
|
|
179
|
+
],
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const { result } = renderHook(() => useSelect(props))
|
|
183
|
+
const expectedSelected = new Map().set(undefined, {
|
|
184
|
+
label: undefined,
|
|
185
|
+
value: undefined,
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
189
|
+
expect(result.current.query).toBe('')
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
it('initializes correctly when an empty value is provided', () => {
|
|
193
|
+
const props: SelectProps = {
|
|
194
|
+
multiple: true,
|
|
195
|
+
name: 'anything',
|
|
196
|
+
value: [{}],
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const { result } = renderHook(() => useSelect(props))
|
|
200
|
+
|
|
201
|
+
const expectedSelected = new Map()
|
|
202
|
+
|
|
203
|
+
expect(result.current.selectable.selected).toEqual(expectedSelected)
|
|
204
|
+
expect(result.current.query).toBe('')
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
})
|
|
@@ -13,7 +13,13 @@ import { isThenable } from 'utils/toolset/isThenable'
|
|
|
13
13
|
import toArray from 'utils/toolset/toArray'
|
|
14
14
|
import { GenericAdapter } from './Select.constants'
|
|
15
15
|
import { useSelectable } from './Select.context'
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
escapeRegExp,
|
|
18
|
+
getAdapter,
|
|
19
|
+
getDisplayValue,
|
|
20
|
+
getValue,
|
|
21
|
+
toSelection,
|
|
22
|
+
} from './useSelect.helpers'
|
|
17
23
|
|
|
18
24
|
import type { ChangeEvent, FocusEvent } from 'react'
|
|
19
25
|
import type {
|
|
@@ -213,7 +219,7 @@ function useSelect(props: SelectProps): useSelectReturn {
|
|
|
213
219
|
const adapters = useMemo<Adapters>(() => extractAdapters(datasources), [datasources])
|
|
214
220
|
|
|
215
221
|
const selectable = useSelectable({
|
|
216
|
-
selected:
|
|
222
|
+
selected: toSelection(props.value),
|
|
217
223
|
multiple,
|
|
218
224
|
adapters,
|
|
219
225
|
onChange: useCallback(
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
fireEvent,
|
|
4
|
-
queries,
|
|
5
|
-
waitFor,
|
|
6
|
-
within,
|
|
7
|
-
waitForElementToBeRemoved,
|
|
8
|
-
} from '@testing-library/dom'
|
|
1
|
+
import { fireEvent, waitFor, within, waitForElementToBeRemoved } from '@testing-library/react'
|
|
9
2
|
import { act } from '@testing-library/react'
|
|
10
3
|
import userEvent from '@testing-library/user-event'
|
|
11
4
|
|
|
@@ -26,6 +19,7 @@ function getSelectMenu(input: HTMLElement): HTMLElement {
|
|
|
26
19
|
}
|
|
27
20
|
|
|
28
21
|
function getSelectTriggerHandle(input: HTMLElement): HTMLElement {
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
29
23
|
return input.parentNode!.nextSibling!.nextSibling as HTMLElement
|
|
30
24
|
}
|
|
31
25
|
|
|
@@ -60,12 +54,12 @@ function isSelectMenuExpanded(input: HTMLElement): boolean {
|
|
|
60
54
|
async function waitForPendingQuery(input: HTMLElement) {
|
|
61
55
|
const searchContainer = getSelectSearchContainer(input)
|
|
62
56
|
|
|
63
|
-
if (!
|
|
57
|
+
if (!within(searchContainer).queryByTestId('select-trigger-loading')) {
|
|
64
58
|
return
|
|
65
59
|
}
|
|
66
60
|
|
|
67
61
|
await waitForElementToBeRemoved(
|
|
68
|
-
() =>
|
|
62
|
+
() => within(searchContainer).queryByTestId('select-trigger-loading'),
|
|
69
63
|
{ timeout: 2500 }
|
|
70
64
|
)
|
|
71
65
|
}
|
|
@@ -88,11 +82,10 @@ async function expand(input: HTMLElement): Promise<void> {
|
|
|
88
82
|
expect(triggerHandle).toBeEnabled()
|
|
89
83
|
})
|
|
90
84
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
})
|
|
85
|
+
userEvent.click(triggerHandle)
|
|
86
|
+
|
|
87
|
+
await waitFor(async () => {
|
|
88
|
+
expect(await within(getSelectContainer(input)).findByRole('listbox')).toBeInTheDocument()
|
|
96
89
|
})
|
|
97
90
|
}
|
|
98
91
|
|
|
@@ -108,12 +101,10 @@ async function collapse(input: HTMLElement): Promise<void> {
|
|
|
108
101
|
|
|
109
102
|
const triggerHandle = getSelectTriggerHandle(input)
|
|
110
103
|
|
|
111
|
-
|
|
112
|
-
userEvent.click(triggerHandle)
|
|
104
|
+
userEvent.click(triggerHandle)
|
|
113
105
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
})
|
|
106
|
+
await waitFor(() => {
|
|
107
|
+
expect(within(getSelectContainer(input)).queryByRole('listbox')).not.toBeInTheDocument()
|
|
117
108
|
})
|
|
118
109
|
}
|
|
119
110
|
|
|
@@ -129,14 +120,12 @@ async function select(option: string, input: HTMLElement): Promise<void> {
|
|
|
129
120
|
|
|
130
121
|
const menuContainer = getSelectMenu(input)
|
|
131
122
|
|
|
132
|
-
await
|
|
133
|
-
const optionElement = await queries.findByLabelText(menuContainer, option)
|
|
123
|
+
const optionElement = await within(menuContainer).findByLabelText(option)
|
|
134
124
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
})
|
|
125
|
+
// click the option if exists; Select currently closes when an item is clicked.
|
|
126
|
+
if (optionElement && optionElement.getAttribute('aria-selected') == 'false') {
|
|
127
|
+
userEvent.click(optionElement)
|
|
128
|
+
}
|
|
140
129
|
|
|
141
130
|
// we collapse in the case the option was not clicked
|
|
142
131
|
await collapse(input)
|
|
@@ -154,14 +143,12 @@ async function unselect(option: string, input: HTMLElement): Promise<void> {
|
|
|
154
143
|
|
|
155
144
|
const menuContainer = getSelectMenu(input)
|
|
156
145
|
|
|
157
|
-
await
|
|
158
|
-
const optionElement = await queries.findByLabelText(menuContainer, option)
|
|
146
|
+
const optionElement = await within(menuContainer).findByLabelText(option)
|
|
159
147
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
})
|
|
148
|
+
// ensures that the option exists and IS selected
|
|
149
|
+
if (optionElement && optionElement.getAttribute('aria-selected') == 'true') {
|
|
150
|
+
userEvent.click(optionElement)
|
|
151
|
+
}
|
|
165
152
|
|
|
166
153
|
// we collapse in the case the option was not clicked
|
|
167
154
|
await collapse(input)
|
|
@@ -177,9 +164,9 @@ async function clear(input: HTMLElement): Promise<void> {
|
|
|
177
164
|
|
|
178
165
|
const searchContainer = getSelectSearchContainer(input)
|
|
179
166
|
|
|
180
|
-
|
|
181
|
-
const clearButton = within(searchContainer).getByTestId('select-trigger-clear')
|
|
167
|
+
const clearButton = within(searchContainer).getByTestId('select-trigger-clear')
|
|
182
168
|
|
|
169
|
+
act(() => {
|
|
183
170
|
if (clearButton) {
|
|
184
171
|
userEvent.click(clearButton)
|
|
185
172
|
}
|
|
@@ -195,11 +182,9 @@ async function clear(input: HTMLElement): Promise<void> {
|
|
|
195
182
|
async function search(query: string, input: HTMLElement): Promise<void> {
|
|
196
183
|
const selectContainer = getSelectContainer(input)
|
|
197
184
|
|
|
198
|
-
|
|
199
|
-
fireEvent.change(input, { target: { value: query } })
|
|
185
|
+
fireEvent.change(input, { target: { value: query } })
|
|
200
186
|
|
|
201
|
-
|
|
202
|
-
})
|
|
187
|
+
await within(selectContainer).findAllByRole('option')
|
|
203
188
|
}
|
|
204
189
|
|
|
205
190
|
/**
|
|
@@ -212,7 +197,8 @@ async function getOptions(input: HTMLElement): Promise<HTMLElement[]> {
|
|
|
212
197
|
|
|
213
198
|
const menuContainer = getSelectMenu(input)
|
|
214
199
|
|
|
215
|
-
const options =
|
|
200
|
+
const options = within(menuContainer).queryAllByRole('option')
|
|
201
|
+
|
|
216
202
|
await collapse(input)
|
|
217
203
|
|
|
218
204
|
return options
|
|
@@ -230,7 +216,7 @@ async function getSelectedOptions(input: HTMLElement): Promise<HTMLElement[]> {
|
|
|
230
216
|
let selectedOptions: HTMLElement[] = []
|
|
231
217
|
|
|
232
218
|
try {
|
|
233
|
-
selectedOptions = await
|
|
219
|
+
selectedOptions = await within(menuContainer).findAllByRole('option', {
|
|
234
220
|
selected: true,
|
|
235
221
|
})
|
|
236
222
|
} catch (err) {
|