Skip to content

Commit a4b3d53

Browse files
committed
Fix tests for VariantAnalysis
1 parent 053d33d commit a4b3d53

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

extensions/ql-vscode/src/view/method-modeling/__tests__/MultipleModeledMethodsPanel.spec.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,11 @@ describe(MultipleModeledMethodsPanel.name, () => {
521521

522522
const render = createRender(modeledMethods);
523523

524-
it("can add modeling", () => {
524+
it("can add modeling", async () => {
525525
render();
526526

527-
expect(
528-
screen.getByLabelText("Add modeling").getElementsByTagName("input")[0],
529-
).toBeEnabled();
527+
const addButton = await screen.findByLabelText("Add modeling");
528+
expect(addButton).toBeEnabled();
530529
});
531530

532531
it("can delete first modeling", async () => {

extensions/ql-vscode/src/view/variant-analysis/__tests__/VariantAnalysis.spec.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render as reactRender, screen, waitFor } from "@testing-library/react";
1+
import { render as reactRender, screen } from "@testing-library/react";
22
import {
33
VariantAnalysisFailureReason,
44
VariantAnalysisStatus,
@@ -57,9 +57,6 @@ describe(VariantAnalysis.name, () => {
5757
const variantAnalysis = createMockVariantAnalysis({});
5858
render({ variantAnalysis });
5959

60-
await waitFor(() => screen.getByDisplayValue("All"));
61-
await waitFor(() => screen.getByDisplayValue("Number of results"));
62-
6360
await postMessage<ToVariantAnalysisMessage>({
6461
t: "setFilterSortState",
6562
filterSortState: {
@@ -69,8 +66,11 @@ describe(VariantAnalysis.name, () => {
6966
},
7067
});
7168

72-
expect(screen.getByDisplayValue("With results")).toBeInTheDocument();
73-
expect(screen.getByDisplayValue("Alphabetically")).toBeInTheDocument();
69+
const withResults = await screen.findByText("With results");
70+
expect(withResults).toBeInTheDocument();
71+
72+
const alphabetically = await screen.findByText("Alphabetically");
73+
expect(alphabetically).toBeInTheDocument();
7474

7575
expect(screen.queryByDisplayValue("All")).not.toBeInTheDocument();
7676
expect(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy