Skip to content

Commit 43dd966

Browse files
committed
mock debounce
1 parent da21529 commit 43dd966

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Frontend/test/specs/heartbeats/configuring-heartbeats.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test, describe } from "../../drivers/vitest/driver";
22
import * as precondition from "../../preconditions";
3-
import { expect } from "vitest";
3+
import { expect, vi } from "vitest";
44
import { getNothingToConfigureStatus } from "./questions/getNothingToConfigureStatus";
55
import { navigateToHeartbeatsConfiguration, navigateToUnHealthyHeartbeats } from "./actions/navigateToHeartbeatsTabs";
66
import { getEndpointsForConfiguration } from "./questions/getEndpointsForConfiguration";
@@ -12,6 +12,11 @@ import { healthyEndpointTemplate } from "../../mocks/heartbeat-endpoint-template
1212
import { setHeartbeatFilter } from "./actions/setHeartbeatFilter";
1313
import { getHeartbeatFilterValue } from "./questions/getHeartbeatFilterValue";
1414

15+
vi.mock("lodash/debounce", () => ({
16+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
17+
default: (fn: Function) => fn,
18+
}));
19+
1520
describe("FEATURE: Heartbeats configuration", () => {
1621
describe("RULE: A list of all endpoints with the heartbeats plug-in installed should be displayed", () => {
1722
test("EXAMPLE: With no endpoints, the text 'Nothing to configure' should be displayed", async ({ driver }) => {

src/Frontend/test/specs/monitoring/filtering-endpoints.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect } from "vitest";
1+
import { vi, expect } from "vitest";
22
import { test, describe } from "../../drivers/vitest/driver";
33
import { enterFilterString } from "./actions/enterFilterString";
44
import { groupEndpointsBy } from "./actions/groupEndpointsBy";
@@ -8,6 +8,11 @@ import { currentFilterValueToBe } from "./questions/currentFilterValueToBe";
88
import { endpointsNames } from "./questions/endpointsNames";
99
import * as precondition from "../../preconditions";
1010

11+
vi.mock("lodash/debounce", () => ({
12+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
13+
default: (fn: Function) => fn,
14+
}));
15+
1116
describe("FEATURE: Endpoint filtering", () => {
1217
describe("RULE: List of monitoring endpoints should be filterable by the name", () => {
1318
[

0 commit comments

Comments
 (0)