Skip to content

Commit c98e83c

Browse files
committed
FE: Fix flaky host summary tooltip test
1 parent 85bef77 commit c98e83c

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

frontend/pages/hosts/details/cards/HostSummary/HostSummary.tests.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { noop } from "lodash";
3-
import { screen, waitFor } from "@testing-library/react";
3+
import { screen, fireEvent } from "@testing-library/react";
44
import { createCustomRenderer } from "test/test-utils";
55

66
import createMockUser from "__mocks__/userMock";
@@ -60,18 +60,17 @@ describe("Host Summary section", () => {
6060
);
6161

6262
expect(screen.getByText("Agent")).toBeInTheDocument();
63-
await waitFor(() => {
64-
waitFor(() => {
65-
user.hover(screen.getByText(new RegExp(orbitVersion, "i")));
66-
});
6763

68-
expect(
69-
screen.getByText(new RegExp(osqueryVersion, "i"))
70-
).toBeInTheDocument();
71-
expect(
72-
screen.getByText(new RegExp(fleetdVersion, "i"))
73-
).toBeInTheDocument();
74-
});
64+
await fireEvent.mouseEnter(
65+
screen.getByText(new RegExp(orbitVersion, "i"))
66+
);
67+
68+
expect(
69+
screen.getByText(new RegExp(osqueryVersion, "i"))
70+
).toBeInTheDocument();
71+
expect(
72+
screen.getByText(new RegExp(fleetdVersion, "i"))
73+
).toBeInTheDocument();
7574
});
7675

7776
it("omit fleet desktop from tooltip if no fleet desktop version", async () => {

0 commit comments

Comments
 (0)