1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix react-beautiful-dnd mocks

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-12-05 14:18:16 -05:00
parent c68a1bfd04
commit c6c2bb920a

View File

@ -11,5 +11,49 @@ import type {
} from "react-beautiful-dnd"; } from "react-beautiful-dnd";
export const DragDropContext = ({ children }: DragDropContextProps) => <>{ children }</>; export const DragDropContext = ({ children }: DragDropContextProps) => <>{ children }</>;
export const Draggable = ({ children }: DraggableProps) => <>{ children({} as any, {} as any, {} as any) }</>; export const Draggable = ({ children }: DraggableProps) => (
export const Droppable = ({ children }: DroppableProps) => <>{ children({} as any, {} as any) }</>; <>
{
children(
{
draggableProps: {
"data-rbd-draggable-context-id": "some-mock-rbd-draggable-context-id",
"data-rbd-draggable-id": "some-mock-rbd-draggable-id",
},
innerRef: () => {},
},
{
isDragging: false,
isDropAnimating: false,
},
{
draggableId: "some-mock-draggable-id",
mode: "FLUID",
source: {
droppableId: "some-mock-droppable-id",
index: 0,
},
},
)
}
</>
);
export const Droppable = ({ children }: DroppableProps) => (
<>
{
children(
{
droppableProps: {
"data-rbd-droppable-context-id": "some-mock-rbd-droppable-context-id",
"data-rbd-droppable-id": "some-mock-rbd-droppable-id",
},
innerRef: () => {},
},
{
isDraggingOver: false,
isUsingPlaceholder: false,
},
)
}
</>
);