File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/view/variant-analysis/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as React from "react" ;
2- import { render as reactRender , screen } from "@testing-library/react" ;
2+ import { render as reactRender , screen , waitFor } from "@testing-library/react" ;
33import {
44 VariantAnalysisFailureReason ,
55 VariantAnalysisStatus ,
@@ -54,11 +54,8 @@ describe(VariantAnalysis.name, () => {
5454 const variantAnalysis = createMockVariantAnalysis ( { } ) ;
5555 render ( { variantAnalysis } ) ;
5656
57- // Without this await, `getByDisplayValue` could not find any selected dropdown option.
58- await new Promise ( ( resolve ) => setTimeout ( resolve , 0 ) ) ;
59-
60- expect ( screen . getByDisplayValue ( "With results" ) ) . toBeInTheDocument ( ) ;
61- expect ( screen . getByDisplayValue ( "Number of results" ) ) . toBeInTheDocument ( ) ;
57+ await waitFor ( ( ) => screen . getByDisplayValue ( "With results" ) ) ;
58+ await waitFor ( ( ) => screen . getByDisplayValue ( "Number of results" ) ) ;
6259
6360 await postMessage < ToVariantAnalysisMessage > ( {
6461 t : "setVariantAnalysis" ,
You can’t perform that action at this time.
0 commit comments