Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(api/test): bad test running on selfhost suite

mogery3a0da674f13a
diff --git a/apps/api/src/__tests__/snips/v2/scrape-browser.test.ts b/apps/api/src/__tests__/snips/v2/scrape-browser.test.ts
index 960df30c0..09920ce79 100644
--- a/apps/api/src/__tests__/snips/v2/scrape-browser.test.ts
+++ b/apps/api/src/__tests__/snips/v2/scrape-browser.test.ts
@@ -4,6 +4,7 @@ import {
ALLOW_TEST_SUITE_WEBSITE,
HAS_FIRE_ENGINE,
TEST_PRODUCTION,
+ TEST_SELF_HOST,
TEST_SUITE_WEBSITE,
itIf,
} from "../lib";
@@ -188,37 +189,43 @@ describe("Scrape browser interact replay", () => {
scrapeTimeout,
);
- it("returns 400 for invalid scrape job id format", async () => {
- const response = await scrapeInteractRaw(
- "not-a-valid-uuid",
- {
- code: "console.log('hi')",
- language: "node",
- },
- identity,
- );
-
- expect(response.statusCode).toBe(400);
- expect(response.body.success).toBe(false);
- expect(response.body.error).toBe(
- "Invalid job ID format. Job ID must be a valid UUID.",
- );
- });
-
- it("returns 404 when scrape job does not exist", async () => {
- const response = await scrapeInteractRaw(
- crypto.randomUUID(),
- {
- code: "console.log('hi')",
- language: "node",
- },
- identity,
- );
-
- expect(response.statusCode).toBe(404);
- expect(response.body.success).toBe(false);
- expect(response.body.error).toBe("Job not found.");
- });
+ itIf(!TEST_SELF_HOST)(
+ "returns 400 for invalid scrape job id format",
+ async () => {
+ const response = await scrapeInteractRaw(
+ "not-a-valid-uuid",
+ {
+ code: "console.log('hi')",
+ language: "node",
+ },
+ identity,
+ );
+
+ expect(response.statusCode).toBe(400);
+ expect(response.body.success).toBe(false);
+ expect(response.body.error).toBe(
+ "Invalid job ID format. Job ID must be a valid UUID.",
+ );
+ },
+ );
+
+ itIf(!TEST_SELF_HOST)(
+ "returns 404 when scrape job does not exist",
+ async () => {
+ const response = await scrapeInteractRaw(
+ crypto.randomUUID(),
+ {
+ code: "console.log('hi')",
+ language: "node",
+ },
+ identity,
+ );
+
+ expect(response.statusCode).toBe(404);
+ expect(response.body.success).toBe(false);
+ expect(response.body.error).toBe("Job not found.");
+ },
+ );
itIf(ALLOW_TEST_SUITE_WEBSITE && !!config.IDMUX_URL)(
"returns 403 when scrape job belongs to another team",