UI: Add Tooltip show delay across app (#33091)

## For #31869

- Add fine grain controls for tooltip show and hide delay behavior
- Default to 250ms show delay across app
- Update ~30 unit tests to expect new delay
- See
[note](https://github.com/fleetdm/fleet/issues/31869#issuecomment-3300660487)


https://github.com/user-attachments/assets/5969e0f7-c137-491f-8430-6f21d01b9350

- [x] Changes file added for user-visible changes in `changes/`
- [x] QA'd all new/changed functionality manually

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
jacobshandling
2025-09-18 09:42:30 -07:00
committed by GitHub
co-authored by Jacob Shandling
parent 7085a731d6
commit 06c48216f7
20 changed files with 254 additions and 133 deletions
@@ -1,6 +1,7 @@
import React from "react";
import { render, screen, fireEvent } from "@testing-library/react";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { renderWithSetup } from "test/test-utils";
// @ts-ignore
import InputFieldWithIcon from "./InputFieldWithIcon";
@@ -111,7 +112,7 @@ describe("InputFieldWithIcon Component", () => {
});
test("renders tooltip when provided", async () => {
render(
const { user } = renderWithSetup(
<InputFieldWithIcon
value=""
onChange={mockOnChange}
@@ -122,8 +123,10 @@ describe("InputFieldWithIcon Component", () => {
/>
);
await fireEvent.mouseEnter(screen.getByText(/test input/i));
const tooltip = screen.getByText("This is a tooltip.");
expect(tooltip).toBeInTheDocument();
await user.hover(screen.getByText(/test input/i));
await waitFor(() => {
const tooltip = screen.getByText("This is a tooltip.");
expect(tooltip).toBeInTheDocument();
});
});
});