

























@@ -14,6 +14,7 @@ import {
1414createGoogleMeetSpace,
1515fetchGoogleMeetArtifacts,
1616fetchGoogleMeetAttendance,
17+fetchLatestGoogleMeetConferenceRecord,
1718fetchGoogleMeetSpace,
1819normalizeGoogleMeetSpaceName,
1920} from "./src/meet.js";
@@ -343,6 +344,7 @@ describe("google-meet plugin", () => {
343344"setup_status",
344345"resolve_space",
345346"preflight",
347+"latest",
346348"artifacts",
347349"attendance",
348350"recover_current_tab",
@@ -496,6 +498,32 @@ describe("google-meet plugin", () => {
496498);
497499});
498500501+it("fetches only the latest Meet conference record for a meeting", async () => {
502+const fetchMock = stubMeetArtifactsApi();
503+504+await expect(
505+fetchLatestGoogleMeetConferenceRecord({
506+accessToken: "token",
507+meeting: "abc-defg-hij",
508+}),
509+).resolves.toMatchObject({
510+input: "abc-defg-hij",
511+space: { name: "spaces/abc-defg-hij" },
512+conferenceRecord: { name: "conferenceRecords/rec-1" },
513+});
514+515+const listCall = fetchMock.mock.calls.find(([input]) => {
516+const url = requestUrl(input);
517+return url.pathname === "/v2/conferenceRecords";
518+});
519+if (!listCall) {
520+throw new Error("Expected conferenceRecords.list fetch call");
521+}
522+const listUrl = requestUrl(listCall[0]);
523+expect(listUrl.searchParams.get("pageSize")).toBe("1");
524+expect(listUrl.searchParams.get("filter")).toBe('space.name = "spaces/abc-defg-hij"');
525+});
526+499527it("lists Meet attendance rows with participant sessions", async () => {
500528const fetchMock = stubMeetArtifactsApi();
501529@@ -695,6 +723,26 @@ describe("google-meet plugin", () => {
695723expect(result.details.attendance).toEqual([expect.objectContaining({ displayName: "Alice" })]);
696724});
697725726+it("reports the latest conference record through the tool", async () => {
727+stubMeetArtifactsApi();
728+const { tools } = setup();
729+const tool = tools[0] as {
730+execute: (
731+id: string,
732+params: unknown,
733+) => Promise<{ details: { conferenceRecord?: { name?: string } } }>;
734+};
735+736+const result = await tool.execute("id", {
737+action: "latest",
738+accessToken: "token",
739+expiresAt: Date.now() + 120_000,
740+meeting: "abc-defg-hij",
741+});
742+743+expect(result.details.conferenceRecord).toMatchObject({ name: "conferenceRecords/rec-1" });
744+});
745+698746it("fails setup status when the configured Chrome node is not connected", async () => {
699747const { tools } = setup(
700748{
@@ -918,6 +966,37 @@ describe("google-meet plugin", () => {
918966}
919967});
920968969+it("CLI latest prints the latest conference record", async () => {
970+stubMeetArtifactsApi();
971+const program = new Command();
972+const stdout = captureStdout();
973+registerGoogleMeetCli({
974+ program,
975+config: resolveGoogleMeetConfig({}),
976+ensureRuntime: async () => ({}) as unknown as GoogleMeetRuntime,
977+});
978+979+try {
980+await program.parseAsync(
981+[
982+"googlemeet",
983+"latest",
984+"--access-token",
985+"token",
986+"--expires-at",
987+String(Date.now() + 120_000),
988+"--meeting",
989+"abc-defg-hij",
990+],
991+{ from: "user" },
992+);
993+expect(stdout.output()).toContain("space: spaces/abc-defg-hij");
994+expect(stdout.output()).toContain("conference record: conferenceRecords/rec-1");
995+} finally {
996+stdout.restore();
997+}
998+});
999+9211000it("CLI artifacts writes markdown output", async () => {
9221001stubMeetArtifactsApi();
9231002const program = new Command();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。