diff --git a/src/visualProgrammingUI/components/DragDropSidebar.tsx b/src/visualProgrammingUI/components/DragDropSidebar.tsx index b3926d9..f1bf6bd 100644 --- a/src/visualProgrammingUI/components/DragDropSidebar.tsx +++ b/src/visualProgrammingUI/components/DragDropSidebar.tsx @@ -27,8 +27,7 @@ function DraggableNode({ className, children, nodeType, onDrop }: DraggableNodeP const draggableRef = useRef(null); const [position, setPosition] = useState({ x: 0, y: 0 }); - - // @ts-ignore + // @ts-expect-error we expect the null referece here. useDraggable(draggableRef, { position: position, onDrag: ({ offsetX, offsetY }) => { diff --git a/test/pages/connectedRobots/ConnectedRobots.test.tsx b/test/pages/connectedRobots/ConnectedRobots.test.tsx index c2d3749..017b2a2 100644 --- a/test/pages/connectedRobots/ConnectedRobots.test.tsx +++ b/test/pages/connectedRobots/ConnectedRobots.test.tsx @@ -25,7 +25,9 @@ class MockEventSource { // mock event source generation with fake function that returns our fake mock source beforeAll(() => { - (globalThis as any).EventSource = jest.fn((url: string) => new MockEventSource(url)); + // Cast globalThis to a type exposing EventSource and assign a mocked constructor. + (globalThis as unknown as { EventSource?: typeof EventSource }).EventSource = + jest.fn((url: string) => new MockEventSource(url)) as unknown as typeof EventSource; }); // clean after tests