Skip to content

Commit 24373b3

Browse files
author
Vincent Molinié
committed
fix: update test to match new route name
1 parent e06a567 commit 24373b3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/mcp-server/src/server.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,15 @@ describe('ForestAdminMCPServer Instance', () => {
268268
});
269269
});
270270

271-
describe('/authorize endpoint', () => {
271+
describe('/oauth/authorize endpoint', () => {
272272
it('should return 400 when required parameters are missing', async () => {
273-
const response = await request(httpServer).get('/authorize');
273+
const response = await request(httpServer).get('/oauth/authorize');
274274

275275
expect(response.status).toBe(400);
276276
});
277277

278278
it('should return 400 when client_id is missing', async () => {
279-
const response = await request(httpServer).get('/authorize').query({
279+
const response = await request(httpServer).get('/oauth/authorize').query({
280280
redirect_uri: 'https://example.com/callback',
281281
response_type: 'code',
282282
code_challenge: 'test-challenge',
@@ -288,7 +288,7 @@ describe('ForestAdminMCPServer Instance', () => {
288288
});
289289

290290
it('should return 400 when redirect_uri is missing', async () => {
291-
const response = await request(httpServer).get('/authorize').query({
291+
const response = await request(httpServer).get('/oauth/authorize').query({
292292
client_id: 'test-client',
293293
response_type: 'code',
294294
code_challenge: 'test-challenge',
@@ -300,7 +300,7 @@ describe('ForestAdminMCPServer Instance', () => {
300300
});
301301

302302
it('should return 400 when code_challenge is missing', async () => {
303-
const response = await request(httpServer).get('/authorize').query({
303+
const response = await request(httpServer).get('/oauth/authorize').query({
304304
client_id: 'test-client',
305305
redirect_uri: 'https://example.com/callback',
306306
response_type: 'code',
@@ -312,7 +312,7 @@ describe('ForestAdminMCPServer Instance', () => {
312312
});
313313

314314
it('should return 400 when client is not registered', async () => {
315-
const response = await request(httpServer).get('/authorize').query({
315+
const response = await request(httpServer).get('/oauth/authorize').query({
316316
client_id: 'unregistered-client',
317317
redirect_uri: 'https://example.com/callback',
318318
response_type: 'code',
@@ -326,7 +326,7 @@ describe('ForestAdminMCPServer Instance', () => {
326326
});
327327

328328
it('should redirect to Forest Admin frontend with correct parameters', async () => {
329-
const response = await request(httpServer).get('/authorize').query({
329+
const response = await request(httpServer).get('/oauth/authorize').query({
330330
client_id: 'registered-client',
331331
redirect_uri: 'https://example.com/callback',
332332
response_type: 'code',
@@ -351,7 +351,7 @@ describe('ForestAdminMCPServer Instance', () => {
351351
});
352352

353353
it('should redirect to default frontend when FOREST_FRONTEND_HOSTNAME is not set', async () => {
354-
const response = await request(httpServer).get('/authorize').query({
354+
const response = await request(httpServer).get('/oauth/authorize').query({
355355
client_id: 'registered-client',
356356
redirect_uri: 'https://example.com/callback',
357357
response_type: 'code',
@@ -369,7 +369,7 @@ describe('ForestAdminMCPServer Instance', () => {
369369

370370
it('should handle POST method for authorize', async () => {
371371
// POST /authorize uses form-encoded body
372-
const response = await request(httpServer).post('/authorize').type('form').send({
372+
const response = await request(httpServer).post('/oauth/authorize').type('form').send({
373373
client_id: 'registered-client',
374374
redirect_uri: 'https://example.com/callback',
375375
response_type: 'code',

0 commit comments

Comments
 (0)