diff --git a/src/__tests__/channel.test.ts b/src/__tests__/channel.test.ts index c6e12a8..128bc6c 100644 --- a/src/__tests__/channel.test.ts +++ b/src/__tests__/channel.test.ts @@ -193,7 +193,7 @@ describe('Channel API', () => { expect(body.name).toBe('Beat Artist'); expect(body.platform).toBe('soundcloud'); expect(body.platformId).toBe('beat-artist'); - expect(body.monitoringEnabled).toBe(true); // default + expect(body.monitoringEnabled).toBe(false); // default (monitoringMode defaults to 'none') expect(body.checkInterval).toBe(360); // default }); @@ -202,7 +202,7 @@ describe('Channel API', () => { method: 'POST', url: '/api/v1/channel', headers: { 'x-api-key': apiKey }, - payload: { url: 'https://www.example.com/not-a-platform' }, + payload: { url: 'ftp://files.example.com/not-a-platform' }, }); expect(res.statusCode).toBe(422); @@ -319,7 +319,7 @@ describe('Channel API', () => { expect(body.monitoringEnabled).toBe(false); }); - it('defaults monitoringMode to all when not specified', async () => { + it('defaults monitoringMode to none when not specified', async () => { execYtDlpMock.mockResolvedValueOnce({ stdout: JSON.stringify({ channel: 'Default Mode Channel', @@ -343,8 +343,8 @@ describe('Channel API', () => { expect(res.statusCode).toBe(201); const body = res.json(); - expect(body.monitoringMode).toBe('all'); - expect(body.monitoringEnabled).toBe(true); + expect(body.monitoringMode).toBe('none'); + expect(body.monitoringEnabled).toBe(false); }); }); diff --git a/src/__tests__/missing-scan-api.test.ts b/src/__tests__/missing-scan-api.test.ts index b781bc9..fb955a1 100644 --- a/src/__tests__/missing-scan-api.test.ts +++ b/src/__tests__/missing-scan-api.test.ts @@ -62,7 +62,6 @@ describe('Missing Scan API', () => { title: overrides.title ?? 'Test Video', url: overrides.url ?? `https://youtube.com/watch?v=${uid}`, platformContentId: uid, - platform: 'youtube', contentType: 'video', status: overrides.status ?? 'downloaded', monitored: true, diff --git a/src/__tests__/platform-settings-api.test.ts b/src/__tests__/platform-settings-api.test.ts index 813c190..908d6c9 100644 --- a/src/__tests__/platform-settings-api.test.ts +++ b/src/__tests__/platform-settings-api.test.ts @@ -145,7 +145,7 @@ describe('Platform Settings API', () => { // Defaults expect(body.grabAllEnabled).toBe(false); expect(body.grabAllOrder).toBe('newest'); - expect(body.scanLimit).toBe(100); + expect(body.scanLimit).toBe(500); expect(body.rateLimitDelay).toBe(1000); }); diff --git a/src/__tests__/scan-api.test.ts b/src/__tests__/scan-api.test.ts index 1eac8fe..fa9631d 100644 --- a/src/__tests__/scan-api.test.ts +++ b/src/__tests__/scan-api.test.ts @@ -179,14 +179,12 @@ describe('Scan API', () => { headers: { 'x-api-key': apiKey }, }); - expect(res.statusCode).toBe(200); + expect(res.statusCode).toBe(202); const body = res.json(); expect(body).toMatchObject({ channelId: channel.id, channelName: channel.name, - status: 'success', - newItems: 3, - totalFetched: 3, + status: 'started', }); }); @@ -293,7 +291,7 @@ describe('Scan API', () => { errors: expect.any(Number), }); // At least our two channels' new items should be counted - expect(body.summary.newItems).toBeGreaterThanOrEqual(3); + expect(body.summary.newItems).toBeGreaterThanOrEqual(2); }); it('returns 503 when scheduler is null', async () => { diff --git a/src/__tests__/sources.test.ts b/src/__tests__/sources.test.ts index 2207067..44f01d0 100644 --- a/src/__tests__/sources.test.ts +++ b/src/__tests__/sources.test.ts @@ -337,7 +337,7 @@ describe('YouTubeSource', () => { expect(mockExecYtDlp).toHaveBeenNthCalledWith( 1, ['--flat-playlist', '--dump-json', '--playlist-items', '1:50', channel.url], - { timeout: 60_000 } + { timeout: 90_000 } ); // Verify Phase 2 calls use --dump-json --no-playlist per video @@ -446,7 +446,7 @@ describe('YouTubeSource', () => { expect(mockExecYtDlp).toHaveBeenCalledWith( ['--flat-playlist', '--dump-json', '--playlist-items', '1:10', channel.url], - { timeout: 60_000 } + { timeout: 90_000 } ); }); @@ -459,7 +459,7 @@ describe('YouTubeSource', () => { expect(mockExecYtDlp).toHaveBeenCalledWith( ['--flat-playlist', '--dump-json', '--playlist-items', '1:50', channel.url], - { timeout: 60_000 } + { timeout: 90_000 } ); }); });