Skip to content

Commit f207cc2

Browse files
committed
add test based on Zuzka suggestion
1 parent 4a402d8 commit f207cc2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/integration/suite.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,5 +910,35 @@ export function createIntegrationTestsSuite(
910910
expect(output[0]).toHaveProperty('second_number', input.second_number);
911911
expect(output[0]).toHaveProperty('sum', input.first_number + input.second_number);
912912
});
913+
914+
it('should return Actor details both for full Actor name and ID', async () => {
915+
const actorName = 'apify/python-example';
916+
const apifyClient = new ApifyClient({ token: process.env.APIFY_TOKEN as string });
917+
const actor = await apifyClient.actor(actorName).get();
918+
expect(actor).toBeDefined();
919+
const actorId = actor!.id as string;
920+
921+
client = await createClientFn();
922+
923+
// Fetch by full Actor name
924+
const resultByName = await client.callTool({
925+
name: 'fetch-actor-details',
926+
arguments: { actor: actorName },
927+
});
928+
expect(resultByName.content).toBeDefined();
929+
const contentByName = resultByName.content as { text: string }[];
930+
expect(contentByName[0].text).toContain(actorName);
931+
932+
// Fetch by Actor ID only
933+
const resultById = await client.callTool({
934+
name: 'fetch-actor-details',
935+
arguments: { actor: actorId },
936+
});
937+
expect(resultById.content).toBeDefined();
938+
const contentById = resultById.content as { text: string }[];
939+
expect(contentById[0].text).toContain(actorName);
940+
941+
await client.close();
942+
});
913943
});
914944
}

0 commit comments

Comments
 (0)