feat(admin): 模型排序 - 支持搜索并移动到指定位置

This commit is contained in:
Codex committed 2026-09-21 15:38:21 +08:00
1 parent 4e0b0a9256
commit 17a2618ba5
6 files changed
+51 -8

No files matched your search

+3
View File
@@ -51,5 +51,8 @@ test("sorting exposes a simple settings entry and moves items without changing t
expect(moveOrderItem(rows, "c", 0).map((item) => item.id)).toEqual(["c", "a", "b"]);
expect(moveOrderItem(rows, "a", 2).map((item) => item.id)).toEqual(["b", "c", "a"]);
expect(moveOrderItem(rows, "a", -1)).toBe(rows);
expect(moveOrderItem(rows, "a", 1.5)).toBe(rows);
expect(moveOrderItem(rows, "a", Number.NaN)).toBe(rows);
expect(moveOrderItem(rows, "a", rows.length)).toBe(rows);
expect(rows.map((item) => item.id)).toEqual(["a", "b", "c"]);
});