From be35b32306e5f0e1e98e5821983db308cda7efa4 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 18 Apr 2024 13:55:55 -0700 Subject: [PATCH] Nick: preview token tests --- apps/api/src/__tests__/e2e/index.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/api/src/__tests__/e2e/index.test.ts b/apps/api/src/__tests__/e2e/index.test.ts index ce11207..7a7600f 100644 --- a/apps/api/src/__tests__/e2e/index.test.ts +++ b/apps/api/src/__tests__/e2e/index.test.ts @@ -36,6 +36,14 @@ describe('E2E Tests for API Routes', () => { .send({ url: 'https://firecrawl.dev' }); expect(response.statusCode).toBe(401); }); + it('should return a successful response with a valid preview token', async () => { + const response = await request(TEST_URL) + .post('/v0/scrape') + .set('Authorization', `Bearer this_is_just_a_preview_token`) + .set('Content-Type', 'application/json') + .send({ url: 'https://firecrawl.dev' }); + expect(response.statusCode).toBe(200); + }); it('should return a successful response with a valid API key', async () => { const response = await request(TEST_URL)