Files
dbx/packages/app-tests/treeNodeIcon.test.ts
T
LSD fa5e55a376 feat(mongodb): improve GridFS manager filtering and sorting
* docs: add GridFS manager filter and sort design

* feat: improve GridFS manager filtering and sorting
2026-07-06 17:17:33 +08:00

20 lines
890 B
TypeScript

import assert from "node:assert/strict";
import { test } from "vitest";
import { getTreeNodeIconInfo } from "../../apps/desktop/src/lib/sidebar/treeNodeIcon.ts";
import type { TreeNode } from "../../apps/desktop/src/types/database.ts";
test("GridFS sidebar nodes use a dedicated cool-color icon treatment", () => {
const gridfs = getTreeNodeIconInfo({ type: "mongo-gridfs" } as TreeNode);
const bucket = getTreeNodeIconInfo({ type: "mongo-bucket" } as TreeNode);
assert.equal(gridfs?.colorClass, "text-cyan-500");
assert.equal(bucket?.colorClass, "text-cyan-400");
});
test("GridFS sidebar icon mapping stays distinct from Mongo collections", () => {
const gridfs = getTreeNodeIconInfo({ type: "mongo-gridfs" } as TreeNode);
const collection = getTreeNodeIconInfo({ type: "mongo-collection" } as TreeNode);
assert.notEqual(gridfs?.colorClass, collection?.colorClass);
});