28 lines
844 B
TypeScript
28 lines
844 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const source = (path: string) => readFileSync(resolve(process.cwd(), path), "utf8");
|
|
|
|
describe("réimport d'une facture supprimée", () => {
|
|
it("ne traite plus une entrée deletedInvoices comme un doublon", () => {
|
|
for (const path of [
|
|
"server/routers.ts",
|
|
"server/emailImportService.ts",
|
|
"server/_core/index.ts",
|
|
]) {
|
|
expect(source(path)).not.toContain("isInvoiceBlacklisted");
|
|
}
|
|
});
|
|
|
|
it("conserve uniquement la détection des doublons réellement présents", () => {
|
|
for (const path of [
|
|
"server/routers.ts",
|
|
"server/emailImportService.ts",
|
|
"server/_core/index.ts",
|
|
]) {
|
|
expect(source(path)).toContain("findDuplicateInvoice");
|
|
}
|
|
});
|
|
});
|