mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-10 01:09:43 +02:00
Merge #551: remove the broken tunnel upload page and deprecate /api/screenshots
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user