@@ -7,11 +7,11 @@ import {
77} from './list-all-components.ts' ;
88import type { StorybookContext } from '../types.ts' ;
99import smallManifestFixture from '../../fixtures/small-manifest.fixture.json' with { type : 'json' } ;
10- import * as fetchManifest from '../utils/fetch -manifest.ts' ;
10+ import * as getManifest from '../utils/get -manifest.ts' ;
1111
1212describe ( 'listAllComponentsTool' , ( ) => {
1313 let server : McpServer < any , StorybookContext > ;
14- let fetchManifestSpy : any ;
14+ let getManifestSpy : any ;
1515
1616 beforeEach ( async ( ) => {
1717 const adapter = new ValibotJsonSchemaAdapter ( ) ;
@@ -45,9 +45,9 @@ describe('listAllComponentsTool', () => {
4545 ) ;
4646 await addListAllComponentsTool ( server ) ;
4747
48- // Mock fetchManifest to return the fixture
49- fetchManifestSpy = vi . spyOn ( fetchManifest , 'fetchManifest ' ) ;
50- fetchManifestSpy . mockResolvedValue ( smallManifestFixture ) ;
48+ // Mock getManifest to return the fixture
49+ getManifestSpy = vi . spyOn ( getManifest , 'getManifest ' ) ;
50+ getManifestSpy . mockResolvedValue ( smallManifestFixture ) ;
5151 } ) ;
5252
5353 it ( 'should return a list of all components' , async ( ) => {
@@ -98,8 +98,8 @@ describe('listAllComponentsTool', () => {
9898 } ) ;
9999
100100 it ( 'should handle fetch errors gracefully' , async ( ) => {
101- fetchManifestSpy . mockRejectedValue (
102- new fetchManifest . ManifestFetchError (
101+ getManifestSpy . mockRejectedValue (
102+ new getManifest . ManifestGetError (
103103 'Failed to fetch manifest: 404 Not Found' ,
104104 'https://example.com/manifest.json' ,
105105 ) ,
@@ -121,7 +121,7 @@ describe('listAllComponentsTool', () => {
121121 {
122122 "content": [
123123 {
124- "text": "Error fetching manifest: Failed to fetch manifest: 404 Not Found",
124+ "text": "Error getting manifest: Failed to fetch manifest: 404 Not Found",
125125 "type": "text",
126126 },
127127 ],
@@ -131,7 +131,7 @@ describe('listAllComponentsTool', () => {
131131 } ) ;
132132
133133 it ( 'should handle unexpected errors gracefully' , async ( ) => {
134- fetchManifestSpy . mockRejectedValue ( new Error ( 'Network timeout' ) ) ;
134+ getManifestSpy . mockRejectedValue ( new Error ( 'Network timeout' ) ) ;
135135
136136 const request = {
137137 jsonrpc : '2.0' as const ,
0 commit comments