Improve application responsiveness and background processing
This commit is contained in:
@@ -18,8 +18,13 @@ describe('server detail data', () => {
|
||||
for (let n = 0; n < 501; n++) { deployment.run('other-' + n, '2026-09-18'); member.run('other-' + n, 'other'); }
|
||||
})();
|
||||
const { GET } = await import('../../src/routes/api/campaigns/+server.js');
|
||||
const all = await (await GET({ url: new URL('http://localhost/api/campaigns') })).json();
|
||||
const all = await (await GET({ url: new URL('http://localhost/api/campaigns?limit=500') })).json();
|
||||
expect(all.deployments).toHaveLength(500);
|
||||
const first = await (await GET({ url: new URL('http://localhost/api/campaigns?limit=25') })).json();
|
||||
const second = await (await GET({ url: new URL('http://localhost/api/campaigns?limit=25&offset=25') })).json();
|
||||
expect(first.total).toBe(502);
|
||||
expect(first.deployments).toHaveLength(25);
|
||||
expect(new Set([...first.deployments, ...second.deployments].map(row => row.id)).size).toBe(50);
|
||||
const filtered = await (await GET({ url: new URL('http://localhost/api/campaigns?server=target') })).json();
|
||||
expect(filtered.deployments.map((row: { id: string }) => row.id)).toEqual(['older-target']);
|
||||
expect(filtered.deployments[0].servers).toHaveLength(2);
|
||||
|
||||
Reference in New Issue
Block a user