fix(grid): copy NULL cells as empty fields

This commit is contained in:
李子凡 authored and GitHub committed 2026-08-31 16:57:33 +08:00
1 parent 27f62fe6e2
commit 0e9f92c917
11 files changed
+113 -16

No files matched your search

@@ -3,6 +3,11 @@ import { describe, expect, it } from "vitest";
import { DEFAULT_DATA_GRID_EXTRACTOR_OPTIONS, normalizeDataGridCopyPreference, normalizeDataGridExtractorOptions, resolveDataGridCopyPreference, validateDataGridExtractorOptions } from "@/lib/dataGrid/dataGridCopyExtractor";
describe("data-grid extractor options", () => {
it("defaults DSV NULL output to an empty spreadsheet field", () => {
expect(DEFAULT_DATA_GRID_EXTRACTOR_OPTIONS.dsv.nullText).toBe("");
expect(normalizeDataGridExtractorOptions({}).dsv.nullText).toBe("");
});
it("resolves smart copy to raw for one cell and TSV otherwise", () => {
expect(normalizeDataGridCopyPreference(undefined)).toBe("smart");
expect(normalizeDataGridCopyPreference("smart")).toBe("smart");