



























@@ -45,7 +45,7 @@ describe("Codex plugin inventory", () => {
4545]);
4646}
4747if (method === "plugin/read") {
48-expect(params).toMatchObject({
48+expect(params).toEqual({
4949marketplacePath: "/marketplaces/openai-curated",
5050pluginName: "google-calendar",
5151});
@@ -56,13 +56,21 @@ describe("Codex plugin inventory", () => {
5656});
57575858expect(inventory.records).toHaveLength(1);
59-expect(inventory.records[0]).toMatchObject({
60-policy: { pluginName: "google-calendar" },
61-summary: { installed: true, enabled: true },
62-appOwnership: "proven",
63-ownedAppIds: ["google-calendar-app"],
64-apps: [{ id: "google-calendar-app", accessible: true, enabled: true }],
65-});
59+const record = inventory.records[0];
60+expect(record?.policy.pluginName).toBe("google-calendar");
61+expect(record?.summary.installed).toBe(true);
62+expect(record?.summary.enabled).toBe(true);
63+expect(record?.appOwnership).toBe("proven");
64+expect(record?.ownedAppIds).toStrictEqual(["google-calendar-app"]);
65+expect(record?.apps).toStrictEqual([
66+{
67+id: "google-calendar-app",
68+name: "google-calendar-app",
69+accessible: true,
70+enabled: true,
71+needsAuth: false,
72+},
73+]);
6674expect(calls).toEqual(["plugin/list", "plugin/read"]);
6775});
6876@@ -108,7 +116,7 @@ describe("Codex plugin inventory", () => {
108116return listed;
109117}
110118if (method === "plugin/read") {
111-expect(params).toMatchObject({
119+expect(params).toEqual({
112120marketplacePath: "/marketplaces/openai-curated",
113121pluginName: "github",
114122});
@@ -119,12 +127,13 @@ describe("Codex plugin inventory", () => {
119127});
120128121129expect(inventory.records).toHaveLength(1);
122-expect(inventory.records[0]).toMatchObject({
123-policy: { pluginName: "github" },
124-summary: { id: "openai-curated/github", installed: true, enabled: true },
125-appOwnership: "proven",
126-ownedAppIds: ["github-app"],
127-});
130+const record = inventory.records[0];
131+expect(record?.policy.pluginName).toBe("github");
132+expect(record?.summary.id).toBe("openai-curated/github");
133+expect(record?.summary.installed).toBe(true);
134+expect(record?.summary.enabled).toBe(true);
135+expect(record?.appOwnership).toBe("proven");
136+expect(record?.ownedAppIds).toStrictEqual(["github-app"]);
128137expect(inventory.diagnostics.map((diagnostic) => diagnostic.code)).not.toContain(
129138"plugin_missing",
130139);
@@ -166,19 +175,19 @@ describe("Codex plugin inventory", () => {
166175},
167176});
168177169-expect(inventory.records[0]).toMatchObject({
170- appOwnership: "proven",
171- authRequired: true,
172- ownedAppIds: ["google-calendar-app"],
173- apps: [
174- {
175- id: "google-calendar-app",
176- accessible: false,
177- enabled: false,
178- needsAuth: true,
179-},
180-],
181-});
178+const record = inventory.records[0];
179+expect(record?.appOwnership).toBe("proven");
180+expect(record?.authRequired).toBe(true);
181+expect(record?.ownedAppIds).toStrictEqual(["google-calendar-app"]);
182+expect(record?.apps).toStrictEqual([
183+{
184+id: "google-calendar-app",
185+name: "google-calendar-app",
186+accessible: false,
187+enabled: false,
188+needsAuth: true,
189+},
190+]);
182191});
183192184193it("marks display-name-only app matches ambiguous instead of exposing app ids", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。