Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

test(grid): stub RecycleScroller module in batch paste spec

t8y2c4e17f7eb779
diff --git a/apps/desktop/src/components/grid/__tests__/DataGridBatchPasteFromCell.spec.ts b/apps/desktop/src/components/grid/__tests__/DataGridBatchPasteFromCell.spec.ts
index e182bfc477..919a9a1486 100644
--- a/apps/desktop/src/components/grid/__tests__/DataGridBatchPasteFromCell.spec.ts
+++ b/apps/desktop/src/components/grid/__tests__/DataGridBatchPasteFromCell.spec.ts
@@ -9,6 +9,30 @@ import type { CustomSaveHandler } from "@/composables/useDataGridEditor";
import { buildMongoUpdateDocument } from "@/lib/mongo/mongoDocumentValues";
import { TooltipProvider } from "@/components/ui/tooltip";
+// DataGrid.vue imports RecycleScroller directly (no global registration),
+// so the module itself must be stubbed for deterministic row rendering.
+vi.mock("vue-virtual-scroller", async () => {
+ const { defineComponent, h } = await import("vue");
+ return {
+ RecycleScroller: defineComponent({
+ props: {
+ items: {
+ type: Array as PropType<unknown[]>,
+ default: () => [],
+ },
+ },
+ setup(props, { attrs, slots }) {
+ return () =>
+ h(
+ "div",
+ attrs,
+ props.items.map((item) => slots.default?.({ item })),
+ );
+ },
+ }),
+ };
+});
+
vi.mock("@/composables/useDataGridColumnResize", async (importOriginal) => {
const actual = await importOriginal<typeof import("@/composables/useDataGridColumnResize")>();
const { ref } = await import("vue");