fix(table-paste): surface first batch paste error

Closes #4832
This commit is contained in:
t8y2 committed 2026-08-23 16:24:19 +00:00
1 parent e1eb44f626
commit 72bb880ee7
6 files changed
+74 -10

No files matched your search

@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { tableClipboardMatchesTarget, tableClipboardMenuState, tableClipboardSourceContext } from "@/lib/table/tableClipboard";
import { tableClipboardMatchesTarget, tableClipboardMenuState, tableClipboardSourceContext, tablePasteFeedback } from "@/lib/table/tableClipboard";
describe("table clipboard contexts", () => {
const source = { connectionId: "source", database: "app", schema: "public" };
@@ -23,4 +23,11 @@ describe("table clipboard contexts", () => {
expect(tableClipboardMenuState([sourceTable], targetTable)).toBe("copy");
expect(tableClipboardMenuState([sourceTable], targetTable, true)).toBe("copy-and-paste");
});
it("keeps batch feedback bounded to the first paste error", () => {
const firstError = { code: "permission-denied" };
const feedback = tablePasteFeedback(0, 3, firstError);
expect(feedback).toEqual({ successCount: 0, failedCount: 3, firstError });
});
});