@@ -2,7 +2,8 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
22import { registerPercyTools } from "../../src/tools/percy-sdk" ;
33import { setUpPercyHandler , simulatePercyChangeHandler } from "../../src/tools/sdk-utils/handler" ;
44import { updateTestsWithPercyCommands } from "../../src/tools/add-percy-snapshots" ;
5- import { runPercyScan } from "../../src/tools/run-percy-scan" ;
5+ // PMAA-100: runPercyScan registration disabled — restore import alongside the test.
6+ // import { runPercyScan } from "../../src/tools/run-percy-scan";
67import { fetchPercyChanges } from "../../src/tools/review-agent" ;
78import { approveOrDeclinePercyBuild } from "../../src/tools/review-agent-utils/percy-approve-reject" ;
89
@@ -13,9 +14,10 @@ vi.mock("../../src/tools/sdk-utils/handler", () => ({
1314vi . mock ( "../../src/tools/add-percy-snapshots" , ( ) => ( {
1415 updateTestsWithPercyCommands : vi . fn ( ) ,
1516} ) ) ;
16- vi . mock ( "../../src/tools/run-percy-scan" , ( ) => ( {
17- runPercyScan : vi . fn ( ) ,
18- } ) ) ;
17+ // PMAA-100: runPercyScan registration disabled — restore mock alongside the test.
18+ // vi.mock("../../src/tools/run-percy-scan", () => ({
19+ // runPercyScan: vi.fn(),
20+ // }));
1921vi . mock ( "../../src/tools/review-agent" , ( ) => ( {
2022 fetchPercyChanges : vi . fn ( ) ,
2123} ) ) ;
@@ -64,7 +66,8 @@ describe("Percy SDK Tools", () => {
6466 expect ( toolNames ) . toContain ( "expandPercyVisualTesting" ) ;
6567 expect ( toolNames ) . toContain ( "addPercySnapshotCommands" ) ;
6668 expect ( toolNames ) . toContain ( "listTestFiles" ) ;
67- expect ( toolNames ) . toContain ( "runPercyScan" ) ;
69+ // PMAA-100: runPercyScan registration disabled — restore once the token leak is fixed.
70+ // expect(toolNames).toContain("runPercyScan");
6871 expect ( toolNames ) . toContain ( "fetchPercyChanges" ) ;
6972 expect ( toolNames ) . toContain ( "managePercyBuildApproval" ) ;
7073 } ) ;
@@ -118,14 +121,15 @@ describe("Percy SDK Tools", () => {
118121 expect ( result . content [ 0 ] . text ) . toContain ( "Commands added" ) ;
119122 } ) ;
120123
121- it ( "runPercyScan - SUCCESS" , async ( ) => {
122- ( runPercyScan as any ) . mockResolvedValue ( {
123- content : [ { type : "text" , text : "Percy scan started" } ] ,
124- } ) ;
125-
126- const result = await handlers [ "runPercyScan" ] ( { projectName : "test" } ) ;
127- expect ( result . content [ 0 ] . text ) . toContain ( "Percy scan" ) ;
128- } ) ;
124+ // PMAA-100: runPercyScan registration disabled — restore once the token leak is fixed.
125+ // it("runPercyScan - SUCCESS", async () => {
126+ // (runPercyScan as any).mockResolvedValue({
127+ // content: [{ type: "text", text: "Percy scan started" }],
128+ // });
129+ //
130+ // const result = await handlers["runPercyScan"]({ projectName: "test" });
131+ // expect(result.content[0].text).toContain("Percy scan");
132+ // });
129133
130134 it ( "fetchPercyChanges - SUCCESS" , async ( ) => {
131135 ( fetchPercyChanges as any ) . mockResolvedValue ( {
0 commit comments