


























@@ -80,6 +80,7 @@ type NodeListResult = {
8080function setup(
8181config: Record<string, unknown> = {},
8282options: {
83+fullConfig?: Record<string, unknown>;
8384nodesListResult?: NodeListResult;
8485nodesInvokeResult?: unknown;
8586browserActResult?: Record<string, unknown>;
@@ -163,6 +164,7 @@ function setup(
163164description: "test",
164165version: "0",
165166source: "test",
167+config: options.fullConfig ?? {},
166168pluginConfig: config,
167169runtime: {
168170system: {
@@ -537,6 +539,94 @@ describe("google-meet plugin", () => {
537539expect(result.details.ok).toBe(true);
538540});
539541542+it("reports Twilio delegation readiness when voice-call is enabled", async () => {
543+vi.stubEnv("TWILIO_ACCOUNT_SID", "AC123");
544+vi.stubEnv("TWILIO_AUTH_TOKEN", "secret");
545+vi.stubEnv("TWILIO_FROM_NUMBER", "+15550001234");
546+const { tools } = setup(
547+{
548+defaultTransport: "chrome-node",
549+chromeNode: { node: "parallels-macos" },
550+},
551+{
552+fullConfig: {
553+plugins: {
554+allow: ["google-meet", "voice-call"],
555+entries: {
556+"voice-call": {
557+enabled: true,
558+config: { provider: "twilio" },
559+},
560+},
561+},
562+},
563+},
564+);
565+const tool = tools[0] as {
566+execute: (
567+id: string,
568+params: unknown,
569+) => Promise<{ details: { ok?: boolean; checks?: unknown[] } }>;
570+};
571+572+const result = await tool.execute("id", { action: "setup_status" });
573+574+expect(result.details.ok).toBe(true);
575+expect(result.details.checks).toEqual(
576+expect.arrayContaining([
577+expect.objectContaining({
578+id: "twilio-voice-call-plugin",
579+ok: true,
580+}),
581+expect.objectContaining({
582+id: "twilio-voice-call-credentials",
583+ok: true,
584+}),
585+]),
586+);
587+});
588+589+it("reports missing voice-call wiring for Twilio transport", async () => {
590+vi.stubEnv("TWILIO_ACCOUNT_SID", "");
591+vi.stubEnv("TWILIO_AUTH_TOKEN", "");
592+vi.stubEnv("TWILIO_FROM_NUMBER", "");
593+const { tools } = setup(
594+{ defaultTransport: "twilio" },
595+{
596+fullConfig: {
597+plugins: {
598+allow: ["google-meet"],
599+entries: {
600+"voice-call": { enabled: false },
601+},
602+},
603+},
604+},
605+);
606+const tool = tools[0] as {
607+execute: (
608+id: string,
609+params: unknown,
610+) => Promise<{ details: { ok?: boolean; checks?: unknown[] } }>;
611+};
612+613+const result = await tool.execute("id", { action: "setup_status" });
614+615+expect(result.details.ok).toBe(false);
616+expect(result.details.checks).toEqual(
617+expect.arrayContaining([
618+expect.objectContaining({
619+id: "twilio-voice-call-plugin",
620+ok: false,
621+}),
622+expect.objectContaining({
623+id: "twilio-voice-call-credentials",
624+ok: false,
625+}),
626+]),
627+);
628+});
629+540630it("launches Chrome after the BlackHole check", async () => {
541631const originalPlatform = process.platform;
542632Object.defineProperty(process, "platform", { value: "darwin" });
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。