Skip to content

Commit ef4737a

Browse files
committed
add naive integration test
1 parent cb2e8e0 commit ef4737a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/integration/suite.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,31 @@ export function createIntegrationTestsSuite(
175175
await client.close();
176176
});
177177

178+
// It should filter out all rental Actors only if we run locally or as standby, where
179+
// we cannot access MongoDB to get the user's rented Actors.
180+
// In case of apify-mcp-server it should include user's rented Actors.
181+
it('should filter out all rental Actors from store search', async () => {
182+
const client = await createClientFn();
183+
184+
const result = await client.callTool({
185+
name: HelperTools.STORE_SEARCH,
186+
arguments: {
187+
search: 'rental',
188+
limit: 100,
189+
},
190+
});
191+
const content = result.content as {text: string}[];
192+
const actors = content.map((item) => JSON.parse(item.text));
193+
expect(actors.length).toBeGreaterThan(0);
194+
195+
// Check that no rental Actors are present
196+
for (const actor of actors) {
197+
expect(actor.currentPricingInfo.pricingModel).not.toBe('FLAT_PRICE_PER_MONTH');
198+
}
199+
200+
await client.close();
201+
});
202+
178203
// Execute only when we can get the MCP server instance - currently skips only stdio
179204
// is skipped because we are running a compiled version through node and there is no way (easy)
180205
// to get the MCP server instance

0 commit comments

Comments
 (0)