Files
demat-facturation/server/webImportSourcesMigration.test.ts

23 lines
823 B
TypeScript

import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
const migration = readFileSync(
resolve(process.cwd(), "drizzle/0036_broken_rattler.sql"),
"utf8",
);
describe("webImportSources migration", () => {
it("conserve l'instruction historique enregistrée", () => {
expect(migration).toMatch(/CREATE TABLE `webImportSources`/);
expect(migration).not.toMatch(/IF NOT EXISTS/);
});
it("définit les colonnes nécessaires au connecteur sans modifier les factures", () => {
expect(migration).toContain("`portalUrl` varchar(500) NOT NULL");
expect(migration).toContain("`loginPassword` text NOT NULL");
expect(migration).toContain("`apiToken` varchar(128) NOT NULL");
expect(migration).not.toContain("invoices");
});
});