@@ -19,7 +19,7 @@ import { describe, it, expect, beforeEach, vi, afterEach } from "vitest";
1919import { Connection , SfProject } from "@salesforce/core" ;
2020import { ReleaseState , Toolset , Services } from "@salesforce/mcp-provider-api" ;
2121import { EnrichmentStatus } from "@salesforce/metadata-enrichment" ;
22- import { ComponentProcessor , EnrichmentHandler , FileProcessor } from "@salesforce/metadata-enrichment" ;
22+ import { SourceComponentProcessor , EnrichmentHandler , FileProcessor } from "@salesforce/metadata-enrichment" ;
2323import type { EnrichmentRequestRecord } from "@salesforce/metadata-enrichment" ;
2424import { ComponentSetBuilder } from "@salesforce/source-deploy-retrieve" ;
2525import { EnrichMetadataMcpTool } from "../../src/tools/enrich_metadata.js" ;
@@ -117,7 +117,7 @@ describe("EnrichMetadataMcpTool", () => {
117117 getConnection : ( ) => Promise . resolve ( mockConnection ) ,
118118 } ) ,
119119 } as unknown as Services ;
120- vi . spyOn ( ComponentProcessor , "getComponentsToSkip" ) . mockReturnValue ( new Set ( ) ) ;
120+ vi . spyOn ( SourceComponentProcessor , "getComponentsToSkip" ) . mockReturnValue ( new Set ( ) ) ;
121121 vi . spyOn ( EnrichmentHandler , "enrich" ) . mockResolvedValue ( [
122122 {
123123 componentName : "myLwc" ,
@@ -128,8 +128,8 @@ describe("EnrichMetadataMcpTool", () => {
128128 status : EnrichmentStatus . SUCCESS ,
129129 } ,
130130 ] as unknown as EnrichmentRequestRecord [ ] ) ;
131- vi . spyOn ( FileProcessor , "updateMetadataFiles " ) . mockResolvedValue (
132- [ ] as unknown as Awaited < ReturnType < typeof FileProcessor . updateMetadataFiles > >
131+ vi . spyOn ( FileProcessor , "updateMetadata " ) . mockResolvedValue (
132+ [ ] as unknown as Awaited < ReturnType < typeof FileProcessor . updateMetadata > >
133133 ) ;
134134 } ) ;
135135
@@ -192,7 +192,7 @@ describe("EnrichMetadataMcpTool", () => {
192192 getConnection : ( ) => Promise . resolve ( mockConnection ) ,
193193 } ) ,
194194 } as unknown as Services ;
195- vi . spyOn ( ComponentProcessor , "getComponentsToSkip" ) . mockReturnValue (
195+ vi . spyOn ( SourceComponentProcessor , "getComponentsToSkip" ) . mockReturnValue (
196196 new Set ( [
197197 { typeName : "LightningComponentBundle" , componentName : "otherCmp" } ,
198198 ] )
@@ -207,8 +207,8 @@ describe("EnrichMetadataMcpTool", () => {
207207 status : EnrichmentStatus . SUCCESS ,
208208 } ,
209209 ] as unknown as EnrichmentRequestRecord [ ] ) ;
210- vi . spyOn ( FileProcessor , "updateMetadataFiles " ) . mockResolvedValue (
211- [ ] as unknown as Awaited < ReturnType < typeof FileProcessor . updateMetadataFiles > >
210+ vi . spyOn ( FileProcessor , "updateMetadata " ) . mockResolvedValue (
211+ [ ] as unknown as Awaited < ReturnType < typeof FileProcessor . updateMetadata > >
212212 ) ;
213213
214214 const tool = new EnrichMetadataMcpTool ( servicesWithConnection ) ;
@@ -220,7 +220,7 @@ describe("EnrichMetadataMcpTool", () => {
220220
221221 expect ( result . isError ) . toBe ( false ) ;
222222 const text = result . content [ 0 ] . type === "text" ? result . content [ 0 ] . text : "" ;
223- expect ( text ) . toContain ( "Metadata enrichment completed. Components enriched: " ) ;
223+ expect ( text ) . toContain ( "Metadata enrichment completed" ) ;
224224 expect ( text ) . toContain ( " • myLwc" ) ;
225225 expect ( text ) . toContain ( "Skipped:" ) ;
226226 expect ( text ) . toContain ( " • otherCmp: Skipped" ) ;
@@ -262,7 +262,7 @@ describe("EnrichMetadataMcpTool", () => {
262262 getConnection : ( ) => Promise . resolve ( mockConnection ) ,
263263 } ) ,
264264 } as unknown as Services ;
265- vi . spyOn ( ComponentProcessor , "getComponentsToSkip" ) . mockReturnValue ( new Set ( ) ) ;
265+ vi . spyOn ( SourceComponentProcessor , "getComponentsToSkip" ) . mockReturnValue ( new Set ( ) ) ;
266266 vi . spyOn ( EnrichmentHandler , "enrich" ) . mockResolvedValue ( [
267267 {
268268 componentName : "myLwc" ,
@@ -281,8 +281,8 @@ describe("EnrichMetadataMcpTool", () => {
281281 status : EnrichmentStatus . FAIL ,
282282 } ,
283283 ] as unknown as EnrichmentRequestRecord [ ] ) ;
284- vi . spyOn ( FileProcessor , "updateMetadataFiles " ) . mockResolvedValue (
285- [ ] as unknown as Awaited < ReturnType < typeof FileProcessor . updateMetadataFiles > >
284+ vi . spyOn ( FileProcessor , "updateMetadata " ) . mockResolvedValue (
285+ [ ] as unknown as Awaited < ReturnType < typeof FileProcessor . updateMetadata > >
286286 ) ;
287287
288288 const tool = new EnrichMetadataMcpTool ( servicesWithConnection ) ;
@@ -294,7 +294,7 @@ describe("EnrichMetadataMcpTool", () => {
294294
295295 expect ( result . isError ) . toBe ( false ) ;
296296 const text = result . content [ 0 ] . type === "text" ? result . content [ 0 ] . text : "" ;
297- expect ( text ) . toContain ( "Metadata enrichment completed. Components enriched: " ) ;
297+ expect ( text ) . toContain ( "Metadata enrichment completed" ) ;
298298 expect ( text ) . toContain ( " • myLwc" ) ;
299299 expect ( text ) . toContain ( "Failed:" ) ;
300300 expect ( text ) . toContain ( " • failedCmp: Enrichment API error" ) ;
@@ -308,7 +308,7 @@ describe("EnrichMetadataMcpTool", () => {
308308 getConnection : ( ) => Promise . resolve ( mockConnection ) ,
309309 } ) ,
310310 } as unknown as Services ;
311- vi . spyOn ( ComponentProcessor , "getComponentsToSkip" ) . mockReturnValue ( new Set ( ) ) ;
311+ vi . spyOn ( SourceComponentProcessor , "getComponentsToSkip" ) . mockReturnValue ( new Set ( ) ) ;
312312 vi . spyOn ( EnrichmentHandler , "enrich" ) . mockResolvedValue ( [
313313 {
314314 componentName : "failedCmp" ,
@@ -319,8 +319,8 @@ describe("EnrichMetadataMcpTool", () => {
319319 status : EnrichmentStatus . FAIL ,
320320 } ,
321321 ] as unknown as EnrichmentRequestRecord [ ] ) ;
322- vi . spyOn ( FileProcessor , "updateMetadataFiles " ) . mockResolvedValue (
323- [ ] as unknown as Awaited < ReturnType < typeof FileProcessor . updateMetadataFiles > >
322+ vi . spyOn ( FileProcessor , "updateMetadata " ) . mockResolvedValue (
323+ [ ] as unknown as Awaited < ReturnType < typeof FileProcessor . updateMetadata > >
324324 ) ;
325325
326326 const tool = new EnrichMetadataMcpTool ( servicesWithConnection ) ;
0 commit comments