feat: show connected robots in ui when getting cb pings #15
@@ -27,8 +27,7 @@ function DraggableNode({ className, children, nodeType, onDrop }: DraggableNodeP
|
|||||||
const draggableRef = useRef<HTMLDivElement>(null);
|
const draggableRef = useRef<HTMLDivElement>(null);
|
||||||
const [position, setPosition] = useState<XYPosition>({ x: 0, y: 0 });
|
const [position, setPosition] = useState<XYPosition>({ x: 0, y: 0 });
|
||||||
|
|
||||||
|
// @ts-expect-error we expect the null referece here.
|
||||||
// @ts-ignore
|
|
||||||
useDraggable(draggableRef, {
|
useDraggable(draggableRef, {
|
||||||
position: position,
|
position: position,
|
||||||
onDrag: ({ offsetX, offsetY }) => {
|
onDrag: ({ offsetX, offsetY }) => {
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ class MockEventSource {
|
|||||||
|
|
||||||
// mock event source generation with fake function that returns our fake mock source
|
// mock event source generation with fake function that returns our fake mock source
|
||||||
beforeAll(() => {
|
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
|
// clean after tests
|
||||||
|
|||||||
Reference in New Issue
Block a user