Merge #551: remove the broken tunnel upload page and deprecate /api/screenshots

This commit is contained in:
Codeman maintainer
2026-10-09 04:50:52 +02:00
13 changed files with 57 additions and 199 deletions
+18
View File
@@ -680,6 +680,24 @@ describe('system-routes', () => {
});
});
describe('/api/screenshots deprecation', () => {
it('warns once across requests and leaves the response unchanged', async () => {
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
try {
mockedExistsSync.mockReturnValue(false);
const first = await harness.app.inject({ method: 'GET', url: '/api/screenshots' });
const second = await harness.app.inject({ method: 'GET', url: '/api/screenshots' });
expect(JSON.parse(first.body)).toEqual({ files: [] });
expect(JSON.parse(second.body)).toEqual({ files: [] });
const deprecations = warn.mock.calls.filter((c) => String(c[0]).includes('/api/screenshots'));
expect(deprecations).toHaveLength(1);
expect(String(deprecations[0][0])).toContain('POST /api/sessions/:id/paste-image');
} finally {
warn.mockRestore();
}
});
});
// ========== GET /api/screenshots/:name ==========
describe('GET /api/screenshots/:name', () => {