File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
import { createWrapper , ElementWrapper , usesDom } from '@cloudscape-design/test-utils-core/dom' ;
4
+ import { escapeSelector } from '@cloudscape-design/test-utils-core/utils' ;
4
5
import { act } from '@cloudscape-design/test-utils-core/utils-dom' ;
5
6
6
7
import InputWrapper from '../input' ;
@@ -32,6 +33,16 @@ export class AutosuggestDropdownWrapper extends BaseDropdownContentWrapper {
32
33
) ;
33
34
}
34
35
36
+ /**
37
+ * Returns an option from the autosuggest by its value
38
+ *
39
+ * @param value The 'value' of the option.
40
+ */
41
+ findOptionByValue ( value : string ) : OptionWrapper | null {
42
+ const toReplace = escapeSelector ( value ) ;
43
+ return this . findComponent ( `.${ OptionWrapper . rootSelector } [data-value="${ toReplace } "]` , OptionWrapper ) ;
44
+ }
45
+
35
46
/**
36
47
* Returns an option from the dropdown.
37
48
*
Original file line number Diff line number Diff line change @@ -184,16 +184,6 @@ export class BaseDropdownContentWrapper extends ComponentWrapper {
184
184
return dropdown . findOpenDropdown ( ) ;
185
185
}
186
186
187
- /**
188
- * Returns an option from the autosuggest by its value
189
- *
190
- * @param value The 'value' of the option.
191
- */
192
- findOptionByValue ( value : string ) : OptionWrapper | null {
193
- const toReplace = escapeSelector ( value ) ;
194
- return this . findComponent ( `.${ OptionWrapper . rootSelector } [data-value="${ toReplace } "]` , OptionWrapper ) ;
195
- }
196
-
197
187
/**
198
188
* Use this element to scroll through the list of options
199
189
*/
@@ -213,6 +203,15 @@ export class DropdownContentWrapper extends BaseDropdownContentWrapper {
213
203
OptionWrapper
214
204
) ;
215
205
}
206
+ /**
207
+ * Returns an option from the autosuggest by its value
208
+ *
209
+ * @param value The 'value' of the option.
210
+ */
211
+ findOptionByValue ( value : string ) : OptionWrapper | null {
212
+ const toReplace = escapeSelector ( value ) ;
213
+ return this . findComponent ( `.${ OptionWrapper . rootSelector } [data-value="${ toReplace } "]` , OptionWrapper ) ;
214
+ }
216
215
217
216
/**
218
217
* Returns an option from the dropdown.
You can’t perform that action at this time.
0 commit comments