import { SHAPE } from '@adalo/constants' import { PushNode, DataNode } from './buildPushTree' import { getXRangeWithY } from './range' export const mockDataNode = ({ id = Math.random().toString(), name = Math.random().toString(), listItems = [], height = 100, visible = true, visibleOnDevice = true, pushNode = undefined, }: Partial): DataNode => ({ id, name, listItems, height, visible, visibleOnDevice, pushNode, }) export const mockPushNode = ({ range = getXRangeWithY(0, 100, 0), originalY = 0, objectId = Math.random().toString(), type = SHAPE, yOffset = 0, originalHeight = 100, pushedBy = [], pushes = [], children = [], dataNode = mockDataNode({}), parent = undefined, }: Partial): PushNode => ({ range, originalY, objectId, type, yOffset, originalHeight, pushedBy, pushes, children, dataNode, parent, })