summaryrefslogtreecommitdiff
path: root/web/js/tests
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-09 20:20:01 +0300
committerPaul Buetow <paul@buetow.org>2026-05-09 20:20:01 +0300
commit02b7027ad83c1d27765f2e78dcedc2eb4df00b34 (patch)
tree96c8a8c7fab1ad19a682787fd146b0c8f5ff43b9 /web/js/tests
parent8aa495df3b3da9213bdf29d7a15c1473fefcc63b (diff)
s1 keep scan progress visible
Diffstat (limited to 'web/js/tests')
-rw-r--r--web/js/tests/admin-rescan.test.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/js/tests/admin-rescan.test.js b/web/js/tests/admin-rescan.test.js
index f1661db..d1f2b20 100644
--- a/web/js/tests/admin-rescan.test.js
+++ b/web/js/tests/admin-rescan.test.js
@@ -1,5 +1,6 @@
import { initKeyboard } from '../keyboard.js';
import { renderScanProgress, triggerRescan } from '../views/admin-status.js';
+import { readFileSync } from 'node:fs';
const failures = [];
const requests = [];
@@ -117,6 +118,15 @@ function testRenderIdleProgressHidesIndicator() {
assert(indicator.classList.hidden === true, 'idle progress should hide the indicator');
}
+function testScanIndicatorOutsideHeader() {
+ const html = readFileSync(new URL('../../index.html', import.meta.url), 'utf8');
+ const header = html.slice(html.indexOf('<header'), html.indexOf('</header>'));
+ const afterHeader = html.slice(html.indexOf('</header>'));
+
+ assert(!header.includes('id="scan-indicator"'), 'scan indicator should not be inside the collapsible header');
+ assert(afterHeader.includes('id="scan-indicator"'), 'scan indicator should remain in the document after the header');
+}
+
async function testTriggerRescanRefreshesProgress() {
requests.length = 0;
rescanStatus = 200;
@@ -143,6 +153,7 @@ console.log('Running admin rescan frontend tests...');
testKeyboardRescanHandler();
testRenderRunningProgress();
testRenderIdleProgressHidesIndicator();
+testScanIndicatorOutsideHeader();
await testTriggerRescanRefreshesProgress();
await testTriggerRescanErrorDoesNotPollProgress();