Allow queued confirmation during source pause
This commit is contained in:
1 parent
a22913129a
commit
b96ab42add
4 files changed
+51
-5
No files matched your search
@@ -24,3 +24,19 @@ test('an operator can pause one source while other lanes continue', async t => {
|
||||
await service.control('resume-source', 'weebcentral');
|
||||
assert.equal(service.state.sourcePaused.weebcentral, undefined);
|
||||
});
|
||||
|
||||
test('confirmation can queue an inspected job without unpausing its source', async t => {
|
||||
const root = await fs.mkdtemp(path.join(os.tmpdir(), 'mc-source-confirm-'));
|
||||
const service = await new ScraperService({ libraryRoot: path.join(root, 'library'),
|
||||
dataRoot: path.join(root, 'data') }).init();
|
||||
t.after(async () => { await service.close(); await fs.rm(root, { recursive: true, force: true }); });
|
||||
const item = { id: 'inspected', source: 'weebcentral', title: 'Sample', sourceTitle: 'Sample',
|
||||
kind: 'inspection', status: 'ready' };
|
||||
service.state.queue.push(item);
|
||||
await service.control('pause-source', 'weebcentral');
|
||||
await service.control('confirm', item.id);
|
||||
assert.equal(item.kind, 'download');
|
||||
assert.equal(item.status, 'queued');
|
||||
assert.equal(service.state.sourcePaused.weebcentral, true);
|
||||
await assert.rejects(service.control('inspect', item.id), /source access block/);
|
||||
});
|
||||
Reference in new issue
Block a user