Skip to content

Commit 8a93122

Browse files
committed
✅(yprovider) add test to prevent silent breaking changes
Per Quentin's request, added a test to ensure developers are warned if the token format is updated, preventing backend compatibility issues.
1 parent 8eb9865 commit 8a93122

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/frontend/servers/y-provider/__tests__/server.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ describe('Server Tests', () => {
101101
expect(response.body.error).toBe('Forbidden: Invalid API Key');
102102
});
103103

104+
test('POST /api/convert-markdown with a Bearer token', async () => {
105+
const response = await request(app as any)
106+
.post('/api/convert-markdown')
107+
.set('Origin', origin)
108+
.set('Authorization', 'Bearer test-secret-api-key');
109+
110+
// Warning: Changing the authorization header to Bearer token format will break backend compatibility with this microservice.
111+
expect(response.status).toBe(403);
112+
});
113+
104114
test('POST /api/convert-markdown with missing body param content', async () => {
105115
const response = await request(app as any)
106116
.post('/api/convert-markdown')

0 commit comments

Comments
 (0)