chore: auto-commit after complete-milestone
All checks were successful
CI / test (push) Successful in 19s

GSD-Unit: M004
This commit is contained in:
jlightner 2026-04-04 07:54:04 +00:00
parent 54e9041058
commit f37cfde0a0
5 changed files with 12 additions and 15 deletions

View file

@ -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);
});
});

View file

@ -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,

View file

@ -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);
});

View file

@ -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 () => {

View file

@ -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 }
);
});
});