@@ -97,14 +97,11 @@ export function createIntegrationTestsSuite(
9797 await client . close ( ) ;
9898 } ) ;
9999
100- it ( 'should list all default tools and Actors, with add/remove tools' , async ( ) => {
100+ it ( 'should list only add-actor when add/remove tools are enabled and no tools/actors specified ' , async ( ) => {
101101 const client = await createClientFn ( { enableAddingActors : true } ) ;
102102 const names = getToolNames ( await client . listTools ( ) ) ;
103- expect ( names . length ) . toEqual ( defaultTools . length + defaults . actors . length + 1 ) ;
104-
105- expectToolNamesToContain ( names , DEFAULT_TOOL_NAMES ) ;
106- expectToolNamesToContain ( names , DEFAULT_ACTOR_NAMES ) ;
107- expectToolNamesToContain ( names , [ addTool . tool . name ] ) ;
103+ expect ( names . length ) . toEqual ( 1 ) ;
104+ expect ( names ) . toContain ( addTool . tool . name ) ;
108105 await client . close ( ) ;
109106 } ) ;
110107
@@ -157,11 +154,10 @@ export function createIntegrationTestsSuite(
157154 await client . close ( ) ;
158155 } ) ;
159156
160- it . only ( 'should load only specified Actors via tools selectors when actors param omitted' , async ( ) => {
157+ it ( 'should load only specified Actors via tools selectors when actors param omitted' , async ( ) => {
161158 const actors = [ 'apify/python-example' ] ;
162159 const client = await createClientFn ( { tools : actors } ) ;
163160 const names = getToolNames ( await client . listTools ( ) ) ;
164- console . log ( names ) ;
165161 // Only the Actor should be loaded
166162 expect ( names ) . toHaveLength ( actors . length ) ;
167163 expect ( names ) . toContain ( actorNameToToolName ( actors [ 0 ] ) ) ;
@@ -198,11 +194,10 @@ export function createIntegrationTestsSuite(
198194 await client . close ( ) ;
199195 } ) ;
200196
201- it ( 'should not add any internal tools when tools param is empty' , async ( ) => {
197+ it ( 'should not add any tools when tools param is empty and actors omitted ' , async ( ) => {
202198 const client = await createClientFn ( { tools : [ ] } ) ;
203199 const names = getToolNames ( await client . listTools ( ) ) ;
204- expect ( names . length ) . toEqual ( defaults . actors . length ) ;
205- expectToolNamesToContain ( names , defaults . actors . map ( ( actor ) => actorNameToToolName ( actor ) ) ) ;
200+ expect ( names . length ) . toEqual ( 0 ) ;
206201 await client . close ( ) ;
207202 } ) ;
208203
@@ -453,7 +448,7 @@ export function createIntegrationTestsSuite(
453448 }
454449 } ) ;
455450
456- it ( 'should NOT include add-actor when disabled even if experimental category is selected ' , async ( ) => {
451+ it ( 'should include add-actor when experimental category is selected even if add/remove tools are disabled ' , async ( ) => {
457452 const client = await createClientFn ( {
458453 enableAddingActors : false ,
459454 tools : [ 'experimental' ] ,
@@ -462,18 +457,12 @@ export function createIntegrationTestsSuite(
462457 const loadedTools = await client . listTools ( ) ;
463458 const toolNames = getToolNames ( loadedTools ) ;
464459
465- // Default actors still load when actors are omitted
466- const expectedActorNames = defaults . actors . map ( ( actor ) => actorNameToToolName ( actor ) ) ;
467- for ( const n of expectedActorNames ) {
468- expect ( toolNames ) . toContain ( n ) ;
469- }
470- // Must not include add-actor
471- expect ( toolNames ) . not . toContain ( addTool . tool . name ) ;
460+ expect ( toolNames ) . toContain ( addTool . tool . name ) ;
472461
473462 await client . close ( ) ;
474463 } ) ;
475464
476- it ( 'should NOT include add-actor when disabled even if tool is selected directly' , async ( ) => {
465+ it ( 'should include add-actor when enableAddingActors disabled and tool add-actor selected directly' , async ( ) => {
477466 const client = await createClientFn ( {
478467 enableAddingActors : false ,
479468 tools : [ addTool . tool . name ] ,
@@ -482,13 +471,8 @@ export function createIntegrationTestsSuite(
482471 const loadedTools = await client . listTools ( ) ;
483472 const toolNames = getToolNames ( loadedTools ) ;
484473
485- // Default actors still load when actors are omitted
486- const expectedActorNames = defaults . actors . map ( ( actor ) => actorNameToToolName ( actor ) ) ;
487- for ( const n of expectedActorNames ) {
488- expect ( toolNames ) . toContain ( n ) ;
489- }
490- // Must not include add-actor
491- expect ( toolNames ) . not . toContain ( addTool . tool . name ) ;
474+ // Must include add-actor since it was selected directly
475+ expect ( toolNames ) . toContain ( addTool . tool . name ) ;
492476
493477 await client . close ( ) ;
494478 } ) ;
0 commit comments