test: tighten msteams credential assertions

This commit is contained in:
Shakker
2026-05-11 08:46:54 +01:00
parent f1190f2ad5
commit 42e1d68a74
+12 -3
View File
@@ -208,11 +208,15 @@ describe("token federated credentials (managed identity)", () => {
useManagedIdentity: false,
} as any;
const result = resolveMSTeamsCredentials(cfg);
expect(result).toMatchObject({
expect(result).toEqual({
type: "federated",
appId: "app-id",
tenantId: "tenant-id",
certificatePath: "/cert.pem",
certificateThumbprint: undefined,
useManagedIdentity: undefined,
managedIdentityClientId: undefined,
});
expect(result).not.toHaveProperty("useManagedIdentity", true);
});
});
@@ -223,7 +227,12 @@ describe("token backward compatibility", () => {
it("defaults to secret when authType is absent", () => {
const cfg = { appId: "app-id", appPassword: "pw", tenantId: "tenant-id" } as any;
const result = resolveMSTeamsCredentials(cfg);
expect(result).toMatchObject({ type: "secret" });
expect(result).toEqual({
type: "secret",
appId: "app-id",
appPassword: "pw",
tenantId: "tenant-id",
});
});
it("explicit authType=secret behaves same as absent", () => {