export const formatDate = (isoDate: string) => {
const date = new Date(isoDate);
- return date.toLocaleString();
+ const text = date.toLocaleString();
+ return text === 'Invalid Date' ? "" : text;
};
export const formatFileSize = (size?: number) => {
columns={[{ name: "Column 1", render: jest.fn(), selected: true }]} />);
expect(dataExplorer.find(ContextMenu).prop("actions")).toEqual([]);
dataExplorer.find(DataTable).prop("onRowContextMenu")({
- preventDefault: jest.fn()
+ preventDefault: jest.fn(),
+ stopPropagation: jest.fn()
}, "Item 1");
dataExplorer.find(ContextMenu).prop("onActionClick")({ name: "Action 1", icon: "" });
expect(onContextAction).toHaveBeenCalledWith({ name: "Action 1", icon: "" }, "Item 1");
PROJECT = "project",
COLLECTION = "collection",
PIPELINE = "pipeline",
- LEVEL_UP = "levelup",
+ LEVEL_UP = "",
UNKNOWN = "unknown"
}
name: "..",
url: getResourceUrl(treeItem.data),
kind: ResourceKind.LEVEL_UP,
- owner: treeItem.data.ownerUuid,
+ owner: "",
uuid: treeItem.data.uuid,
- lastModified: treeItem.data.modifiedAt
+ lastModified: ""
});
if (treeItem.items) {