From 02b7027ad83c1d27765f2e78dcedc2eb4df00b34 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 9 May 2026 20:20:01 +0300 Subject: s1 keep scan progress visible --- web/js/tests/admin-rescan.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'web/js/tests') 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('')); + const afterHeader = html.slice(html.indexOf('')); + + 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(); -- cgit v1.2.3