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

20 lines
750 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 { normalizeLoginMethod } from "./authMethod";
describe("normalizeLoginMethod", () => {
it("conserve les valeurs de lenum DB", () => {
expect(normalizeLoginMethod("local")).toBe("local");
expect(normalizeLoginMethod("azure-ad")).toBe("azure-ad");
});
it("convertit les identifiants de fournisseur Microsoft", () => {
expect(normalizeLoginMethod("Microsoft OAuth")).toBe("azure-ad");
expect(normalizeLoginMethod("AZURE_ENTRA")).toBe("azure-ad");
});
it("utilise Manus pour toute valeur inconnue au lieu déchouer en base", () => {
expect(normalizeLoginMethod("platform-v2")).toBe("manus");
expect(normalizeLoginMethod(undefined)).toBe("manus");
});
});