Run full live catalog refreshes through live source sync, complete channel analysis, EPG source refresh, and persisted EPG rematching while keeping check-new incremental. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
1.6 KiB
JavaScript
23 lines
1.6 KiB
JavaScript
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const root = path.resolve(__dirname, '..');
|
|
const indexHtml = fs.readFileSync(path.join(root, 'public', 'index.html'), 'utf8');
|
|
const settingsSource = fs.readFileSync(path.join(root, 'public', 'js', 'pages', 'Settings.js'), 'utf8');
|
|
|
|
test('Settings exposes separate live check-new and full rebuild actions', () => {
|
|
assert.ok(/id="live-check-new-button"[^>]*>\s*Check for new streams\s*</.test(indexHtml), 'Settings should expose a Check for new streams button');
|
|
assert.ok(/id="live-rebuild-catalog-button"[^>]*>\s*Run full refresh\s*</.test(indexHtml), 'Settings should expose a Run full refresh button');
|
|
assert.match(indexHtml, /Sync IPTV sources and analyze only streams that are not already in the catalog\./);
|
|
assert.match(indexHtml, /Refresh IPTV and EPG data, re-analyze every stream, and rebuild channel-to-EPG matches\./);
|
|
});
|
|
|
|
test('Settings wires check-new and full rebuild buttons to distinct API actions', () => {
|
|
assert.ok(/getElementById\('live-check-new-button'\).*addEventListener/s.test(settingsSource), 'Settings should bind the check-new button');
|
|
assert.ok(/getElementById\('live-rebuild-catalog-button'\).*addEventListener/s.test(settingsSource), 'Settings should bind the full rebuild button');
|
|
assert.ok(/projection\/check-new|checkNewStreams|checkNew/.test(settingsSource), 'Settings should call a check-new API action');
|
|
assert.ok(/projection\/rebuild|rebuildProjection|runLiveAnalysis/.test(settingsSource), 'Settings should keep a full rebuild API action');
|
|
});
|