Skip to content

Commit 91bd32a

Browse files
committed
fix: ci
1 parent 52cb52d commit 91bd32a

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

packages/diracx-web-components/src/components/shared/SearchBar/DatePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import "dayjs/locale/en-gb"; // Import the locale for dayjs
1010
import { TextField, TextFieldProps } from "@mui/material";
1111

1212
interface CustomDateTimePickerProps
13-
extends Omit<DateTimePickerProps<Dayjs>, "value" | "onChange"> {
13+
extends Omit<DateTimePickerProps, "value" | "onChange"> {
1414
value: string | null;
1515
onDateAccepted: (value: string | null) => void;
1616
handleArrowKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;

packages/diracx-web-components/src/components/shared/SearchBar/SearchField.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface SearchFieldProps {
3030
setInputValue: React.Dispatch<React.SetStateAction<string>>;
3131

3232
/** Reference to the input element */
33-
inputRef: React.MutableRefObject<HTMLInputElement | null>;
33+
inputRef: React.RefObject<HTMLInputElement | null>;
3434

3535
/** The current token equations */
3636
tokenEquations: SearchBarTokenEquation[];
@@ -360,8 +360,7 @@ export default function SearchField({
360360
inputRef={(node) => {
361361
const r = autoInputProps.ref;
362362
if (typeof r === "function") r(node);
363-
else if (r)
364-
(r.current as React.MutableRefObject<HTMLInputElement>) = node;
363+
else if (r) r.current = node;
365364
if (inputRef) inputRef.current = node;
366365
}}
367366
inputProps={{

packages/diracx-web-components/src/components/shared/Sunburst/Sunburst.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function Sunburst({
7373
const finalColorScales = colorScales || defaultColorScale;
7474

7575
const svgRef = useRef(null);
76-
const tooltipRef: React.MutableRefObject<HTMLDivElement | null> =
76+
const tooltipRef: React.RefObject<HTMLDivElement | null> =
7777
useRef<HTMLDivElement | null>(null);
7878

7979
const theme = useTheme();

packages/diracx-web-components/test/SearchBar.test.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,23 @@ describe("SearchBar", () => {
7272

7373
const searchInput = screen.getByPlaceholderText("Enter a category");
7474

75-
// Create a category token
75+
// Create a category token (Status)
7676
await user.type(searchInput, "Status");
7777
await user.keyboard("{Enter}");
7878

79-
// Check if operator suggestions appear
79+
// Focus operator input
8080
const operatorInput = screen.getByPlaceholderText("Enter an operator");
81-
await user.type(operatorInput, "{downArrow}");
81+
await user.click(operatorInput);
82+
83+
// Open the autocomplete popup
84+
await user.keyboard("{ArrowDown}");
85+
86+
// Wait for the listbox to appear (ensures popup is open)
87+
await waitFor(() => {
88+
expect(screen.getByRole("listbox")).toBeInTheDocument();
89+
});
90+
91+
// Now expect "=" operator to be one of the suggestions
8292
await waitFor(() => {
8393
expect(screen.getByText("=")).toBeInTheDocument();
8494
});

0 commit comments

Comments
 (0)