docs: help restored to the UI (Cards/SCP81 sections), READMEs updated
The help pages had no SCP81 section and documented Cards as a 3.2 subsection of the SCP80 tab. They now mirror the UI: 3 SCP80 (3.1 Secured Packet, 3.2 RAM), 4 Cards tab, 5 SCP81 tab (5.1 Listener, 5.2 Scripts), with the following sections renumbered (6 Card reader, 7 Profiler, 8 Phone simulator, 9 Server, 10 Compatibility) and the TERMINAL PROFILE range corrected to bytes 1-39 (TS 102 223 5.2 + TS 31.111 5.2). The SCP81 tab and its sub-pills set their own help anchors; a new test asserts every help anchor used by the UI exists in help.html. READMEs: seven top-level tabs, SCP80 two pills, Cards fields/buttons/SCP81 column, SCP81 modes (PSK TLS / pass-through / capture), PSK pairs from presets, Scripts page and resume semantics. SW cache otaman-v178.
This commit is contained in:
@@ -146,3 +146,25 @@ test('profile list has a Profile from snapshot button', () => {
|
||||
assert.ok(html.includes('function profilerScanFromSnapshot(si)'));
|
||||
assert.ok(html.includes('function profilerBuildFileRuleFromSnapshot('));
|
||||
});
|
||||
|
||||
test('every help anchor used by the UI exists in help.html', () => {
|
||||
const help = fs.readFileSync(path.join(__dirname, '..', 'help.html'), 'utf8');
|
||||
const ids = new Set([...help.matchAll(/id="([^"]+)"/g)].map(m => m[1]));
|
||||
const anchors = new Set();
|
||||
// static maps in `xHelpAnchor = {...}` and inline `setHelpAnchor({...})`
|
||||
for (const re of [/HelpAnchor\s*=\s*\{([^}]*)\}/g, /setHelpAnchor\s*\(\s*\{([^}]*)\}/g]) {
|
||||
for (const m of html.matchAll(re)) {
|
||||
for (const v of m[1].matchAll(/'([a-z0-9-]+)'/g)) anchors.add(v[1]);
|
||||
}
|
||||
}
|
||||
for (const m of html.matchAll(/setHelpAnchor\('([^']+)'\)/g)) anchors.add(m[1]);
|
||||
for (const m of html.matchAll(/HelpAnchor\s*=[^;]*\|\|\s*'([a-z0-9-]+)'/g)) anchors.add(m[1]);
|
||||
for (const m of html.matchAll(/setHelpAnchor\s*\([^()]*\|\|\s*'([a-z0-9-]+)'/g)) anchors.add(m[1]);
|
||||
assert.ok(anchors.size >= 15, 'expected at least 15 help anchors, got ' + anchors.size);
|
||||
const missing = [...anchors].filter(a => !ids.has(a));
|
||||
assert.deepStrictEqual(missing, [], 'help.html lacks sections for: ' + missing.join(', '));
|
||||
// the SCP81 tab wires its own anchors and the targets exist
|
||||
assert.ok(ids.has('scp81') && ids.has('scp81-listener') && ids.has('scp81-scripts'));
|
||||
assert.ok(html.includes("'scp81-listener' : 'scp81-scripts'"));
|
||||
assert.ok(html.includes("? 'scp81-scripts' : 'scp81-listener'"));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user