v3.22.0 (fix): an expanded run log stays open across the live report polls
The report view re-renders the member blocks on every poll while a suite runs (innerHTML replacement), so an expanded Run log collapsed within 500 ms. The <details> now carries the stable member index (data-member) and testRenderReport carries the open state across the re-render; the log content keeps updating in place. - frontend/tests/testsuites.test.js: the wiring pin (data-member emitted, the open state read and restored). - sw cache simple-v400 (index.html changed); style.css rebuilt. Tests: 837 frontend + 795 Python.
This commit is contained in:
@@ -184,3 +184,30 @@ test('role rows cannot be moved and the i18n refresh redraws the test views', ()
|
||||
const i18n = extractFunc(html, 'refreshDynamicI18n');
|
||||
assert.match(i18n, /isViewVisible\('phone-sub-test'\)\) testRender\(\)/);
|
||||
});
|
||||
|
||||
test('the report keeps an expanded run log open across the live polls', () => {
|
||||
// A live suite run re-renders the member blocks on every poll; replacing
|
||||
// innerHTML creates fresh <details>, so the open state is carried over
|
||||
// by the stable member index.
|
||||
const member = extractFunc(html, 'testReportMemberHtml');
|
||||
assert.match(member, /data-member="/);
|
||||
const report = extractFunc(html, 'testRenderReport');
|
||||
assert.match(report, /details\[data-member\]/);
|
||||
assert.match(report, /openLogs\[d\.dataset\.member\]/);
|
||||
assert.match(report, /d\.open = true/);
|
||||
});
|
||||
|
||||
test('the report header classes are generated in the prebuilt stylesheet', () => {
|
||||
// The stale-style trap (v3.22.0 review): style.css is a prebuilt Tailwind
|
||||
// output - a class used only in the PWA source has no rule until
|
||||
// `npm run build` runs in frontend/. The report's member header is the
|
||||
// regression case (a near-white bg + dark-theme text made titles vanish).
|
||||
const css = fs.readFileSync(path.join(__dirname, '..', 'style.css'), 'utf8');
|
||||
for (const sel of ['.bg-gray-50', '.dark\\:bg-slate-800\\/50',
|
||||
'.dark\\:text-slate-200', '.bg-purple-100', '.dark\\:bg-purple-900\\/40',
|
||||
'.min-w-\\[12rem\\]']) {
|
||||
assert.ok(css.includes(sel), 'missing rule for ' + sel);
|
||||
}
|
||||
assert.match(extractFunc(html, 'testReportMemberHtml'),
|
||||
/bg-gray-50 dark:bg-slate-800\/50/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user