File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
extensions/ql-vscode/src/view/model-editor/__tests__ Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 2
2
getAllByRole ,
3
3
render as reactRender ,
4
4
screen ,
5
+ waitFor ,
5
6
} from "@testing-library/react" ;
6
7
import { createMethod } from "../../../../test/factories/model-editor/method-factories" ;
7
8
import type { MethodRowProps } from "../MethodRow" ;
@@ -245,7 +246,9 @@ describe(MethodRow.name, () => {
245
246
246
247
const addButton = await screen . findByLabelText ( "Add new model" ) ;
247
248
expect ( addButton ) . toBeInTheDocument ( ) ;
248
- expect ( addButton ) . toBeDisabled ( ) ;
249
+ await waitFor ( ( ) => {
250
+ expect ( addButton ) . toBeDisabled ( ) ;
251
+ } ) ;
249
252
250
253
expect ( screen . queryByLabelText ( "Remove model" ) ) . not . toBeInTheDocument ( ) ;
251
254
} ) ;
@@ -257,7 +260,9 @@ describe(MethodRow.name, () => {
257
260
258
261
const addButton = await screen . findByLabelText ( "Add new model" ) ;
259
262
expect ( addButton ) . toBeInTheDocument ( ) ;
260
- expect ( addButton ) . toBeDisabled ( ) ;
263
+ await waitFor ( ( ) => {
264
+ expect ( addButton ) . toBeDisabled ( ) ;
265
+ } ) ;
261
266
262
267
expect ( screen . queryByLabelText ( "Remove model" ) ) . not . toBeInTheDocument ( ) ;
263
268
} ) ;
Original file line number Diff line number Diff line change 1
- import { render as reactRender , screen } from "@testing-library/react" ;
1
+ import { render as reactRender , screen , waitFor } from "@testing-library/react" ;
2
2
import type { Props } from "../ModelEvaluation" ;
3
3
import { ModelEvaluation } from "../ModelEvaluation" ;
4
4
import { createMockModelEditorViewState } from "../../../../test/factories/model-editor/view-state" ;
@@ -58,7 +58,9 @@ describe(ModelEvaluation.name, () => {
58
58
59
59
const evaluateButton = await screen . findByText ( "Evaluate" ) ;
60
60
expect ( evaluateButton ) . toBeInTheDocument ( ) ;
61
- expect ( evaluateButton ) . toBeDisabled ( ) ;
61
+ await waitFor ( ( ) => {
62
+ expect ( evaluateButton ) . toBeDisabled ( ) ;
63
+ } ) ;
62
64
63
65
expect ( screen . queryByText ( "Stop evaluation" ) ) . not . toBeInTheDocument ( ) ;
64
66
@@ -72,7 +74,9 @@ describe(ModelEvaluation.name, () => {
72
74
73
75
const evaluateButton = await screen . findByText ( "Evaluate" ) ;
74
76
expect ( evaluateButton ) . toBeInTheDocument ( ) ;
75
- expect ( evaluateButton ) . toBeDisabled ( ) ;
77
+ await waitFor ( ( ) => {
78
+ expect ( evaluateButton ) . toBeDisabled ( ) ;
79
+ } ) ;
76
80
77
81
expect ( screen . queryByText ( "Stop evaluation" ) ) . not . toBeInTheDocument ( ) ;
78
82
You can’t perform that action at this time.
0 commit comments