Files
demat-facturation/server/manualWebImport.test.ts
2026-09-30 16:42:27 +02:00

29 lines
1009 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from "vitest";
import {
getManualWebImportAvailability,
runManualWebImport,
summarizeManualWebImport,
} from "./manualWebImport";
describe("manual web import", () => {
it("autorise uniquement le connecteur SFR actuellement implémenté", () => {
expect(getManualWebImportAvailability("sfr")).toEqual({ available: true });
expect(getManualWebImportAvailability("starlink")).toMatchObject({ available: false });
});
it("agrège les résultats d’envoi sans exposer de données de connexion", () => {
expect(
summarizeManualWebImport([
{ imported: 2, duplicates: 1, total: 3 },
{ imported: 0, duplicates: 1, total: 1 },
]),
).toEqual({ imported: 2, duplicates: 2, total: 4 });
});
it("refuse un type non pris en charge avant de démarrer le navigateur", async () => {
await expect(
runManualWebImport({ connectorType: "starlink" } as any),
).rejects.toThrow("n’est pas encore disponible");
});
});