File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
libs/react-components/specs Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ describe("Dropdown Component", () => {
1212 describe ( "Dropdown" , ( ) => {
1313
1414 it ( "should render with the default props" , async ( ) => {
15+
1516 // Setup
1617
1718 const Component = ( ) => {
@@ -294,7 +295,6 @@ describe("Dropdown Component", () => {
294295
295296 const result = render ( < Component /> ) ;
296297 const filter = result . getByTestId ( "input" ) ;
297- const itemLocator = result . getByTestId ( / ^ d r o p d o w n - i t e m / ) ;
298298
299299 // Actions
300300
@@ -469,19 +469,20 @@ describe("Dropdown Component", () => {
469469 } ;
470470
471471 const result = render ( < Component /> ) ;
472- const filter = result . getByRole ( "combobox" ) ;
472+ const filter = result . getByTestId ( "input" ) ;
473+ const filteredOptions = result . getByRole ( "option" ) ;
473474
474475 // Actions
475476 await filter . fill ( "2" ) ;
476477 await filter . click ( ) ;
477478
478479 // Result
479480 await vi . waitFor ( ( ) => {
480- const visibleOptions = result . getByRole ( "option" ) ;
481- expect ( visibleOptions . elements ( ) . length ) . toBe ( 1 ) ;
482- const el = visibleOptions . elements ( ) [ 0 ] as HTMLElement ;
481+ expect ( filteredOptions . elements ( ) . length ) . toBe ( 1 ) ;
482+
483+ const el = filteredOptions . elements ( ) [ 0 ] as HTMLElement ;
483484 expect ( el . getAttribute ( "data-value" ) ) . toBe ( "2" ) ;
484- } ) ;
485+ } , 2000 ) ;
485486 } ) ;
486487 } ) ;
487488} ) ;
You can’t perform that action at this time.
0 commit comments