2026-09-20 14:56:39 -05:00
|
|
|
import { describe, expect, it } from "vitest";
|
2026-10-01 16:20:16 -05:00
|
|
|
import { needsRdpCredentialPrompt } from "../../src/frontend/rdp-credential-prompt";
|
2026-09-20 14:56:39 -05:00
|
|
|
|
|
|
|
|
describe("needsRdpCredentialPrompt", () => {
|
|
|
|
|
it("prompts recipients when RDP has no saved authentication", () => {
|
|
|
|
|
expect(
|
|
|
|
|
needsRdpCredentialPrompt({ protocol: "rdp", rdpAuthType: "none" }),
|
|
|
|
|
).toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("does not prompt when the recipient has a personal override", () => {
|
|
|
|
|
expect(
|
|
|
|
|
needsRdpCredentialPrompt({
|
|
|
|
|
protocol: "rdp",
|
|
|
|
|
rdpAuthType: "none",
|
|
|
|
|
authOverrides: {
|
|
|
|
|
rdp: { credentialId: 7, required: false, ownerAuthShared: true },
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
).toBe(false);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("does not prompt for other protocols", () => {
|
|
|
|
|
expect(
|
|
|
|
|
needsRdpCredentialPrompt({ protocol: "vnc", rdpAuthType: "none" }),
|
|
|
|
|
).toBe(false);
|
|
|
|
|
});
|
|
|
|
|
});
|