33443d4f28
- C-APDU tab renamed Remote APDU (label untranslated EN/RU); Response parser moved from a top-level tab to a pill under it - Profiler moved from the Card reader sub-tabs to a top-level tab - Proactive UICC moved to a top-level tab and renamed Phone simulator - Card reader keeps File manager, Custom files, pySim command line, Raw APDU - modals (event send, profiler scan/snapshot, STK menu) moved outside the tab containers so they can open from any tab - STK overlay disables the top-level tabs while waiting for user input - OTA PoR jump now goes to Remote APDU > Response parser - help EN/RU restructured (2.8 Response parser, 5 Profiler, 6 Phone simulator, subsequent sections renumbered, anchors kept); READMEs and AGENTS.md updated - html.test.js asserts the new tab/pill structure; SW cache v92 -> v93
29 lines
1.2 KiB
JavaScript
29 lines
1.2 KiB
JavaScript
const { test } = require('node:test');
|
|
const assert = require('node:assert');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const html = fs.readFileSync(path.join(__dirname, '..', 'index.html'), 'utf8');
|
|
const opens = (html.match(/<div\b/g) || []).length;
|
|
const closes = (html.match(/<\/div>/g) || []).length;
|
|
|
|
test('HTML <div> tags are balanced', () => {
|
|
assert.strictEqual(opens, closes, `Unbalanced divs: ${opens} opens vs ${closes} closes`);
|
|
});
|
|
|
|
test('top-level tabs match the rearranged views', () => {
|
|
const tabs = [...html.matchAll(/class="tab-btn[^"]*" data-tab="([^"]+)"/g)].map(m => m[1]);
|
|
assert.deepStrictEqual(tabs, ['c-apdu', 'scp80', 'pysim', 'profiler', 'phone']);
|
|
assert.match(html, /data-tab="c-apdu">Remote APDU</);
|
|
});
|
|
|
|
test('response parser is a Remote APDU pill', () => {
|
|
assert.match(html, /data-sub="response" onclick="cApduSwitchSubtab\('response'\)"/);
|
|
assert.ok(html.includes('id="c-apdu-sub-response"'));
|
|
});
|
|
|
|
test('profiler and phone simulator are top-level tab contents', () => {
|
|
assert.ok(html.includes('id="tab-profiler" class="tab-content hidden"'));
|
|
assert.ok(html.includes('id="tab-phone" class="tab-content hidden"'));
|
|
});
|