mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
feat(api): redirect desktop downloads to pkgs (#2853)
This commit is contained in:
@@ -69,18 +69,9 @@ describe('OpenAPI generation from API controllers', () => {
|
||||
expect(responses).not.toHaveProperty('204');
|
||||
});
|
||||
|
||||
it.each([
|
||||
'/dl/desktop/{channel}/{plat}/{arch}/latest/{format}',
|
||||
'/dl/desktop/{channel}/{plat}/{arch}/{version}/{format}',
|
||||
])('distinguishes streamed download bytes from bodyless redirects for %s', (path) => {
|
||||
const responses = document.paths[path].get.responses;
|
||||
for (const status of ['200', '206']) {
|
||||
expect(responses[status].content).toEqual({
|
||||
'*/*': {schema: {$ref: '#/components/schemas/DownloadFileResponse'}},
|
||||
});
|
||||
}
|
||||
expect(responses['302']).toEqual({description: 'Success'});
|
||||
expect(responses).not.toHaveProperty('204');
|
||||
it('keeps every desktop download redirect out of the published document', () => {
|
||||
const published = Object.keys(document.paths).filter((path) => path.startsWith('/dl'));
|
||||
expect(published).toEqual([]);
|
||||
});
|
||||
|
||||
it('publishes stream preview images as binary responses', () => {
|
||||
|
||||
@@ -53,17 +53,13 @@ describe('discoverControllerFiles', () => {
|
||||
const route = routes.find((route) => route.path === '/donations/manage');
|
||||
expect(route?.explicitSecurity).toEqual([]);
|
||||
});
|
||||
it.each(['download_latest_desktop_version_checksum', 'download_desktop_version_checksum'])(
|
||||
'preserves the plain-text checksum response for %s',
|
||||
(operationId) => {
|
||||
const route = routes.find((route) => route.explicitOperationId === operationId);
|
||||
expect(route).toMatchObject({
|
||||
responseSchemaName: 'DownloadChecksumResponse',
|
||||
responseContentType: 'text/plain',
|
||||
explicitStatusCodes: [200],
|
||||
});
|
||||
},
|
||||
);
|
||||
it('leaves every desktop download redirect undocumented', () => {
|
||||
const downloads = routes.filter((route) => route.path.startsWith('/dl'));
|
||||
expect(downloads.length).toBeGreaterThan(0);
|
||||
for (const route of downloads) {
|
||||
expect(route.explicitOperationId).toBeFalsy();
|
||||
}
|
||||
});
|
||||
it('rejects a bodyless status that is absent from the route response statuses', () => {
|
||||
const route = routes.find((route) => route.path === '/donations/manage');
|
||||
assert(route);
|
||||
|
||||
Reference in New Issue
Block a user