3 files changed
+58
-3
No files matched your search
+34
@@ -1,6 +1,40 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { test } from "vitest";
|
||||
import { buildAllDatabaseExportPlan } from "../../apps/desktop/src/lib/export/databaseExport.ts";
|
||||
import { isDatabaseExportTableSelectionValid } from "../../apps/desktop/src/lib/export/databaseExportSelection.ts";
|
||||
|
||||
test("database export allows object-only exports without selecting tables", () => {
|
||||
assert.equal(
|
||||
isDatabaseExportTableSelectionValid({
|
||||
allTableCount: 982,
|
||||
selectedTableCount: 0,
|
||||
includeStructure: false,
|
||||
includeData: false,
|
||||
}),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test("database export still requires a table when exporting structure or data", () => {
|
||||
assert.equal(
|
||||
isDatabaseExportTableSelectionValid({
|
||||
allTableCount: 982,
|
||||
selectedTableCount: 0,
|
||||
includeStructure: true,
|
||||
includeData: false,
|
||||
}),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
isDatabaseExportTableSelectionValid({
|
||||
allTableCount: 982,
|
||||
selectedTableCount: 1,
|
||||
includeStructure: false,
|
||||
includeData: true,
|
||||
}),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test("all-database export includes every schema for schema-aware databases", () => {
|
||||
const plan = buildAllDatabaseExportPlan({
|
||||
|
||||
Reference in new issue
Block a user